All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Jaroslav Kysela <perex@perex.cz>
Cc: ALSA development <alsa-devel@alsa-project.org>
Subject: Re: [PATCH 2/2] ALSA: gus: Fix memory leaks at error paths in memory allocations
Date: Mon, 13 Dec 2021 15:06:42 +0100	[thread overview]
Message-ID: <s5ho85kd2fh.wl-tiwai@suse.de> (raw)
In-Reply-To: <cec12243-783d-830b-e568-da525396b061@perex.cz>

On Mon, 13 Dec 2021 15:02:46 +0100,
Jaroslav Kysela wrote:
> 
> On 13. 12. 21 14:24, Takashi Iwai wrote:
> > When snd_gf1_mem_xalloc() returns NULL, the current code still leaves
> > the formerly allocated block.name string but returns an error
> > immediately.  This patch covers the all callers to deal with the
> > release of leftover name strings in the error paths.
> >
> > Signed-off-by: Takashi Iwai <tiwai@suse.de>
> 
> It may be easier to pass the name to snd_gf1_mem_xalloc() - the code flow is more readable:
(snip)

Thanks, looks like a good idea.

Since the kstrdup() NULL check fix was already applied, I'll resubmit
with the new one.


Takashi

  reply	other threads:[~2021-12-13 14:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-13 13:24 [PATCH 1/2] ALSA: gus: Fix erroneous memory allocation Takashi Iwai
2021-12-13 13:24 ` [PATCH 2/2] ALSA: gus: Fix memory leaks at error paths in memory allocations Takashi Iwai
2021-12-13 14:02   ` Jaroslav Kysela
2021-12-13 14:06     ` Takashi Iwai [this message]
2021-12-13 13:57 ` [PATCH 1/2] ALSA: gus: Fix erroneous memory allocation Jaroslav Kysela

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=s5ho85kd2fh.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=perex@perex.cz \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.