[MPlayer-dev-eng] [PATCH] Fix memory leak in mencoder.c
Thierry Foucu
tfoucu at gmail.com
Mon May 10 18:30:22 CEST 2010
On Wed, May 5, 2010 at 9:28 AM, Thierry Foucu <tfoucu at gmail.com> wrote:
> Hi
>
> $subject
>
> the return of get_path("codecs.conf") is never freed
>
>
>
> Index: mencoder.c
> ===================================================================
> --- mencoder.c (revision 31137)
> +++ mencoder.c (working copy)
> @@ -610,13 +610,17 @@
>
> // check codec.conf
> if(!codecs_file || !parse_codec_cfg(codecs_file)){
> - if(!parse_codec_cfg(get_path("codecs.conf"))){
> - if(!parse_codec_cfg(MPLAYER_CONFDIR "/codecs.conf")){
> - if(!parse_codec_cfg(NULL)){
> - mencoder_exit(1,NULL);
> + const char * conf_file = get_path("codecs.conf");
> + if (conf_file){
> + if(!parse_codec_cfg(get_path("codecs.conf"))){
> + if(!parse_codec_cfg(MPLAYER_CONFDIR "/codecs.conf")){
> + if(!parse_codec_cfg(NULL)){
> + mencoder_exit(1,NULL);
> + }
> + mp_msg(MSGT_MENCODER,MSGL_V,MSGTR_BuiltinCodecsConf);
> }
> - mp_msg(MSGT_MENCODER,MSGL_V,MSGTR_BuiltinCodecsConf);
> }
> + free(conf_file);
> }
> }
>
>
ping?
More information about the MPlayer-dev-eng
mailing list