[FFmpeg-devel] [PATCH] free AVFormatContext::key

Måns Rullgård mans
Sat Sep 25 12:12:14 CEST 2010


Reimar D?ffinger <Reimar.Doeffinger at gmx.de> writes:

> Hello,
> this is malloc'd by the AVOptions, but never freed.
> The easiest solution is to free it manually, though we
> could probably add a AVOptions API that frees everything
> it has allocated...
> Index: ffmpeg.c
> ===================================================================
> --- ffmpeg.c    (revision 25163)
> +++ ffmpeg.c    (working copy)
> @@ -603,8 +603,10 @@
>          av_metadata_free(&s->metadata);
>          av_free(s);
>      }
> -    for(i=0;i<nb_input_files;i++)
> +    for(i=0;i<nb_input_files;i++) {
> +        av_freep(&input_files[i]->key);
>          av_close_input_file(input_files[i]);
> +    }

This is not the leak you are looking for.  That one was fixed in
r24899.  I sent an email explaining the remaining leak, but nobody
cared.  In brief, there is a copy of all options in
cmdutils.c:avformat_opts, which is not being cleaned up.

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list