[vlc-devel] [PATCH] fix memory leak in lib/audio.c

Zhao Zhili wantlamy at gmail.com
Tue Jun 9 07:02:58 CEST 2015


From: Zhao Zhili <wantlamy at gmail.com>

Sorry, this is my first time to submit a patch. And thanks to the stupid
GFW, I don't know
how to make mutt or git-send-mail work with gmail. I have changed the gmail
setting on
browser, hope it meets the requirement now.

On Tue, Jun 9, 2015 at 12:55 AM, Rémi Denis-Courmont <remi at remlab.net>
wrote:

>         Nihao,
>
> Le mardi 09 juin 2015, 00:45:01 Quink a écrit :
> > When one of item->psz_name and item->psz_description is not NULL, I think
> > there is
> > memory leak.
>
> This looks correct, but I think the VideoLAN foundation now requires a
> proper
> author name to attribute the copyright to.
>
> >
> > ---
> >  lib/audio.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/lib/audio.c b/lib/audio.c
> > index 4e0bacc..7901c64 100644
> > --- a/lib/audio.c
> > +++ b/lib/audio.c
> > @@ -86,6 +86,8 @@ libvlc_audio_output_t *
> >          item->psz_description = strdup( module_get_name( module, true )
> );
> >          if( unlikely(item->psz_name == NULL || item->psz_description ==
> > NULL) )
> >          {
> > +            free( item->psz_name );
> > +            free( item->psz_description );
> >              free( item );
> >              goto error;
> >          }
>
> --
> Rémi Denis-Courmont
> http://www.remlab.net/
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20150609/bf12e19b/attachment.html>


More information about the vlc-devel mailing list