[vlc-devel] [PATCH] V4L2: Allow device to be specified with option.
thierry.reding at avionic-design.de
Wed Apr 20 11:15:43 CEST 2011
* Rémi Denis-Courmont wrote:
> On Wednesday 20 April 2011, Thierry Reding wrote:
> > Nothing that hasn't been there before. Although looking at it more closely,
> > p_sys->psz_device is free()'d in CommonClose(), so that is not a leak.
> > However it seems like an additional strdup() is required after the call to
> > var_CreateGetNonEmptyString(), otherwise the variable's value will be
> > free()'d twice. Then again I haven't seen any crashes.
> > Am I overlooking something?
> If I understand the code, previously, p_sys->psz_device would always be NULL
> at that point. Now, you seem to override a possibly non-NULL pointer with
> another one. Then the original pointer is leaked ??
Right. Except that var_CreateGetNonEmptyString() doesn't strdup() the
returned value, so this wouldn't leak anything. But it seems like it will
cause psz_device to be double-free()'d. I will follow up with another patch.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 198 bytes
Desc: not available
More information about the vlc-devel