mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Cc: Jaroslav Kysela <perex@perex.cz>,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sound: synth: emux: soundfont.c:  Cleaning up memory leak
Date: Sun, 01 Jun 2014 14:35:15 +0200	[thread overview]
Message-ID: <s5ha99wvmd8.wl%tiwai@suse.de> (raw)
In-Reply-To: <1401622524-13636-1-git-send-email-rickard_strandqvist@spectrumdigital.se>

At Sun,  1 Jun 2014 13:35:24 +0200,
Rickard Strandqvist wrote:
> 
> 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@spectrumdigital.se>
> ---
>  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);

I applied the patch with the correction of a typo (it must be
kfree()).  At the next time, please compile-test at least :)


thanks,

Takashi

      reply	other threads:[~2014-06-01 12:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-01 11:35 Rickard Strandqvist
2014-06-01 12:35 ` Takashi Iwai [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5ha99wvmd8.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=rickard_strandqvist@spectrumdigital.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®