[pulseaudio-discuss] [PATCH] sink-input, source-output: Fix a leak during property change logging

Tanu Kaskinen tanuk at iki.fi
Wed Aug 10 20:16:22 UTC 2016


On Wed, 2016-08-10 at 21:56 +0200, Peter Meerwald-Stadler wrote:
> Hello,
> 
> > > starring at the same issue ATM :)
> > > the proposed fix below gets rid of the potential leak, but 
>  
> > > (2) in case value == 0, we'd still overwrite old_value, makes no
> > > sense
>> > Why not? value is the new value, old_value is the old value. The new
> > value doesn't affect what we should print in the log message for the
> > old value.
> 
> in case old_value != 0 and value == 0, we'd log
> key: (data) -> (unset)
> but the correct logging IMHO would be
> key: old_value -> (unset)
> 
> new suggestion:
> 
>     if (pa_proplist_contains(o->proplist, key)) {
>         old_value = pa_xstrdup(pa_proplist_gets(o->proplist, key));
>         if (value && old_value && pa_streq(value, old_value))
>             goto finish;
>         if (!old_value)
>             old_value = pa_xstrdup("(data)");
>     } else {

Oh I see. Do you want to send a proper patch?

-- 
Tanu


More information about the pulseaudio-discuss mailing list