[MPlayer-dev-eng] [PATCH] Fix memory leak in mencoder.c

Michael Niedermayer michaelni at gmx.at
Thu May 27 03:02:07 CEST 2010


On Wed, May 05, 2010 at 09:28:31AM -0700, Thierry Foucu 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)){
> +  const char * conf_file = get_path("codecs.conf");
> +  if (conf_file){
> -  if(!parse_codec_cfg(get_path("codecs.conf"))){
> +    if(!parse_codec_cfg(get_path("codecs.conf"))){
> -    if(!parse_codec_cfg(MPLAYER_CONFDIR "/codecs.conf")){
> +      if(!parse_codec_cfg(MPLAYER_CONFDIR "/codecs.conf")){
> -      if(!parse_codec_cfg(NULL)){
> +        if(!parse_codec_cfg(NULL)){
> - mencoder_exit(1,NULL);
> +          mencoder_exit(1,NULL);

cosmetics and functional changes should be in seperate patches

also this looks like a very minor leak, as i susect the code is just run
once


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Old school: Use the lowest level language in which you can solve the problem
            conveniently.
New school: Use the highest level language in which the latest supercomputer
            can solve the problem without the user falling asleep waiting.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20100527/61532549/attachment.pgp>


More information about the MPlayer-dev-eng mailing list