Re: Re: [PATCH] ALSA: usb-audio: Fix memleak in scarlett2_add_new_ctl

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

 




"Takashi Iwai" <tiwai@xxxxxxx>写道:
> On Fri, 07 Aug 2020 09:12:27 +0200,
> Dinghao Liu wrote:
> > 
> > When snd_usb_mixer_add_control() fails, elem needs to be
> > freed just like when snd_ctl_new1() fails. However, current
> > code is returning directly and ends up leaking memory.
> 
> No, this would lead to double-free.  snd_ctl_add() shows a kind of
> special behavior, it already releases the object at its error path.
> 

It's clear to me, thanks!

Regards,
Dinghao




[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