[PATCH v2] ALSA: gus: Fix memory leaks at memory allocator error paths
Jaroslav Kysela
perex at perex.cz
Mon Dec 13 16:15:06 CET 2021
On 13. 12. 21 15:15, 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 does code-refactoring to move the kstrdup()
> call itself into snd_gf1_mem_xalloc() and deals with the resource free
> in the helper code by itself for fixing those memory leaks.
>
> Suggested-by: Jaroslav Kysela <perex at perex.cz>
> Link: https://lore.kernel.org/r/20211213132444.22385-2-tiwai@suse.de
> Signed-off-by: Takashi Iwai <tiwai at suse.de>
Reviewed-by: Jaroslav Kysela <perex at perex.cz>
Thanks.
Jaroslav
--
Jaroslav Kysela <perex at perex.cz>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.
More information about the Alsa-devel
mailing list