1 diff --git a/libavfilter/af_aformat.c b/libavfilter/af_aformat.c
2 index 1a702778c3..232d629ba0 100644
3 --- a/libavfilter/af_aformat.c
4 +++ b/libavfilter/af_aformat.c
5 @@ -112,6 +112,16 @@ static av_cold int init(AVFilterContext *ctx)
9 +#define DEL_FIELD(p,mem,fld) if( p->mem ) { av_freep(&p->mem->fld); av_freep(&p->mem); }
11 +static av_cold void uninit(AVFilterContext *ctx)
13 + AFormatContext *s = ctx->priv;
14 + DEL_FIELD(s, formats, formats);
15 + DEL_FIELD(s, sample_rates, formats);
16 + DEL_FIELD(s, channel_layouts, channel_layouts);
19 static int query_formats(AVFilterContext *ctx)
21 AFormatContext *s = ctx->priv;
22 @@ -149,6 +159,7 @@ AVFilter ff_af_aformat = {
24 .description = NULL_IF_CONFIG_SMALL("Convert the input audio to one of the specified formats."),
27 .query_formats = query_formats,
28 .priv_size = sizeof(AFormatContext),
29 .priv_class = &aformat_class,