ALSA: synth: emux: soundfont.c: Cleaning up memory leak
authorRickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Sun, 1 Jun 2014 11:35:24 +0000 (13:35 +0200)
committerTakashi Iwai <tiwai@suse.de>
Sun, 1 Jun 2014 12:33:09 +0000 (14:33 +0200)
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>
sound/synth/emux/soundfont.c

index 1137b85c36e6d5d9e9c103810975a6f7c79d539f..78683b2064f709a55bf0dff1b2edba002158d114 100644 (file)
@@ -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 */
This page took 0.046348 seconds and 5 git commands to generate.