[pulseaudio-discuss] [PATCH 04/13] modules: Fix resource leak in alsa-ucm

Peter Meerwald pmeerw at pmeerw.net
Tue Dec 17 07:53:36 PST 2013


> > https://scan7.coverity.com:8443/reports.htm#v10205/p10016/fileInstanceId=8833&defectInstanceId=3732&mergedDefectId=591268
> > 
> > Signed-off-by: Peter Meerwald <pmeerw at pmeerw.net>
> > ---
> >  src/modules/alsa/alsa-ucm.c |    3 ---
> >  1 file changed, 3 deletions(-)
> > 
> > diff --git a/src/modules/alsa/alsa-ucm.c b/src/modules/alsa/alsa-ucm.c
> > index c88fc77..f314211 100644
> > --- a/src/modules/alsa/alsa-ucm.c
> > +++ b/src/modules/alsa/alsa-ucm.c
> > @@ -1106,9 +1106,6 @@ static void alsa_mapping_add_ucm_modifier(pa_alsa_mapping *m, pa_alsa_ucm_modifi
> >          m->description = pa_xstrdup(new_desc);
> >      pa_xfree(cur_desc);
> >  
> > -    if (!m->description)
> > -        pa_xstrdup("");
> > -
> 
> Wasn't the intention of this to set the description to an empty string
> if there wasn't a description already or if no description is found in
> the proplist?
> 
> The function right above (alsa_mapping_add_ucm_device()) does the same
> thing:
>         m->description = m->description ? m->description : pa_xstrdup("");

I think you are right, thanks for the suggestion!

-- 

Peter Meerwald
+43-664-2444418 (mobile)


More information about the pulseaudio-discuss mailing list