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@xxxxxxxx> Link: https://lore.kernel.org/r/20211213132444.22385-2-tiwai@xxxxxxx Signed-off-by: Takashi Iwai <tiwai@xxxxxxx>
Reviewed-by: Jaroslav Kysela <perex@xxxxxxxx> Thanks. Jaroslav -- Jaroslav Kysela <perex@xxxxxxxx> Linux Sound Maintainer; ALSA Project; Red Hat, Inc.