[pulseaudio-discuss] [PATCH] alsa-card: Don't free the modargs in pa_init.

Tanu Kaskinen tanu.kaskinen at linux.intel.com
Mon Dec 30 08:52:51 PST 2013


On Wed, 2013-12-25 at 10:14 +0100, Peter Meerwald wrote:
> > The modargs are in both cases (a succesfull as well as a failed module
> > initialization) freed already in pa_done().
> 
> the alsa module keeps a pointer to the modargs; hence, they MUST NOT be 
> freed in the success case
> 
> in the fail case, the pa_modargs_free() is redundant as you noted

It's not entirely redundant. If we jump to fail before u->modargs has
been set, then there will be a memory leak if pa_modargs_free() isn't
called for ma (which I assume is why you added the pa_modargs_free()
calls there in the Coverity patch set).

-- 
Tanu



More information about the pulseaudio-discuss mailing list