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

Rémi Denis-Courmont remi at remlab.net
Mon Jun 8 18:55:24 CEST 2015


	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/




More information about the vlc-devel mailing list