[PATCH] sound: synth: emux: soundfont.c: Cleaning up memory leak

From: Rickard Strandqvist
Date: Sun Jun 01 2014 - 07:34:35 EST


There is a risk for memory leak in when something unexpected happens
and the function returns.

This was largely found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@xxxxxxxxxxxxxxxxxx>
---
sound/synth/emux/soundfont.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/sound/synth/emux/soundfont.c b/sound/synth/emux/soundfont.c
index 1137b85..09c5eeb 100644
--- a/sound/synth/emux/soundfont.c
+++ b/sound/synth/emux/soundfont.c
@@ -1021,6 +1021,7 @@ load_guspatch(struct snd_sf_list *sflist, const char __user *data,
data, count);
if (rc < 0) {
sf_sample_delete(sflist, sf, smp);
+ free(zone);
return rc;
}
/* memory offset is updated after */
--
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/