[MPlayer-dev-eng] [Patch]demux_real.c memleak

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Mon Nov 1 12:51:43 CET 2004


Hi,
>  void demux_close_real(demuxer_t *demuxer)
>  {
> +    int i;
>      real_priv_t* priv = demuxer->priv;
>   
> -    if (priv)
> +    if (priv){
> +    	for(i=0; i<MAX_STREAMS; i++)
> +	   if(priv->index_table[i])
> +	      free(priv->index_table[i]);
>  	free(priv);
> -
> +    }
>      return;
>  }

Please don't change lines that do not have to be changed (I refer to the
removed empty line, and also you can put the { in a separate line, thus
avoiding to change the "if (priv)" line. Also, please put that "int i;"
in the inner block as it's only used there.

Greetings,
Reimar Döffinger




More information about the MPlayer-dev-eng mailing list