summaryrefslogtreecommitdiffstats
path: root/sound/synth
diff options
context:
space:
mode:
authorRickard Strandqvist <rickard_strandqvist@spectrumdigital.se>2014-06-01 13:35:24 +0200
committerTakashi Iwai <tiwai@suse.de>2014-06-01 14:33:09 +0200
commit14577c25169beb8676577490bf2f0bd539d5e999 (patch)
tree2871257d84a53430a2224d08d14ae3a81d9f3834 /sound/synth
parent2c6db77c021e89985c512ec9db9cbc5a34a7e3d9 (diff)
downloadlinux-14577c25169beb8676577490bf2f0bd539d5e999.tar.gz
linux-14577c25169beb8676577490bf2f0bd539d5e999.tar.bz2
linux-14577c25169beb8676577490bf2f0bd539d5e999.zip
ALSA: synth: emux: soundfont.c: Cleaning up memory leak
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. [fixed a typo of kfree() by tiwai] Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/synth')
-rw-r--r--sound/synth/emux/soundfont.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sound/synth/emux/soundfont.c b/sound/synth/emux/soundfont.c
index 1137b85c36e6..78683b2064f7 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);
+ kfree(zone);
return rc;
}
/* memory offset is updated after */