소스 검색

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>
Rickard Strandqvist 11 년 전
부모
커밋
14577c2516
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      sound/synth/emux/soundfont.c

+ 1 - 0
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 */