[vlc-devel] [vlc-commits] RAM: fix memleaks

Rémi Denis-Courmont remi at remlab.net
Sat Apr 23 16:31:48 CEST 2011


   Hello,

On Saturday 23 April 2011, Jean-Baptiste Kempf wrote:
> diff --git a/modules/demux/playlist/ram.c b/modules/demux/playlist/ram.c
> index 1f6e527..cc2af9b 100644
> --- a/modules/demux/playlist/ram.c
> +++ b/modules/demux/playlist/ram.c
> @@ -294,7 +294,10 @@ static int Demux( demux_t *p_demux )
>                          if( i_start )
>                          {
>                              if( asprintf( &temp, ":start-time=%d", i_start
> ) != -1 ) +                            {
>                                  INSERT_ELEM( ppsz_options, i_options,
> i_options, temp ); +                                free( temp );
> +                            }
>                          }

So you insert a string pointer in a table and free immediately it?
That cannot work, can it?

(It should be obvious, but INSERT_ELEM does not copy elements).

-- 
Rémi Denis-Courmont
http://www.remlab.info



More information about the vlc-devel mailing list