Re: [PATCH 2/2] ALSA: gus: Fix memory leaks at error paths in memory allocations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxx>
> 
> 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



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux