[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <s5hef5mmwmo.wl-tiwai@suse.de>
Date: Sun, 28 Apr 2019 09:12:15 +0200
From: Takashi Iwai <tiwai@...e.de>
To: "Wenwen Wang" <wang6495@....edu>
Cc: "moderated list:SOUND" <alsa-devel@...a-project.org>,
"Jorge Sanjuan" <jorge.sanjuan@...ethink.co.uk>,
"Ruslan Bilovol" <ruslan.bilovol@...il.com>,
"Jaroslav Kysela" <perex@...ex.cz>,
"open list" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] ALSA: usb-audio: Fix a memory leak bug
On Sat, 27 Apr 2019 08:06:46 +0200,
Wenwen Wang wrote:
>
> In parse_audio_selector_unit(), the string array 'namelist' is allocated
> through kmalloc_array(), and each string pointer in this array, i.e.,
> 'namelist[]', is allocated through kmalloc() in the following for loop.
> Then, a control instance 'kctl' is created by invoking snd_ctl_new1(). If
> an error occurs during the creation process, the string array 'namelist',
> including all string pointers in the array 'namelist[]', should be freed,
> before the error code ENOMEM is returned. However, the current code does
> not free 'namelist[]', resulting in memory leaks.
>
> To fix the above issue, free all string pointers 'namelist[]' in a loop.
>
> Signed-off-by: Wenwen Wang <wang6495@....edu>
Applied now, thanks.
Takashi
Powered by blists - more mailing lists