From 9f17d4ae7e83e4f4124b28b6aaead61f42ddf223 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Sat, 2 Jan 2016 21:05:40 +0100 Subject: avfilter/formats: fix leak of formats on error Signed-off-by: Paul B Mahol --- libavfilter/formats.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libavfilter') diff --git a/libavfilter/formats.c b/libavfilter/formats.c index a2b19e7603..f12dcf4783 100644 --- a/libavfilter/formats.c +++ b/libavfilter/formats.c @@ -518,6 +518,8 @@ void ff_formats_changeref(AVFilterFormats **oldref, AVFilterFormats **newref) int ret = ref_fn(fmts, &ctx->inputs[i]->out_fmts); \ if (ret < 0) { \ unref_fn(&fmts); \ + av_freep(&fmts->list); \ + av_freep(&fmts); \ return ret; \ } \ count++; \ @@ -528,6 +530,8 @@ void ff_formats_changeref(AVFilterFormats **oldref, AVFilterFormats **newref) int ret = ref_fn(fmts, &ctx->outputs[i]->in_fmts); \ if (ret < 0) { \ unref_fn(&fmts); \ + av_freep(&fmts->list); \ + av_freep(&fmts); \ return ret; \ } \ count++; \ -- cgit v1.2.3