mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-06-11 08:13:06 +00:00
avfilter/avfilter: fix memory leak of filter name in ff_filter_alloc error path
When ff_filter_alloc fails after the name has been allocated (via av_strdup), the error handling code frees inputs and input_pads but misses freeing ret->name, causing a memory leak. Add av_freep(&ret->name) in the error path before freeing inputs.
This commit is contained in:
@@ -760,6 +760,7 @@ AVFilterContext *ff_filter_alloc(const AVFilter *filter, const char *inst_name)
|
||||
err:
|
||||
if (preinited)
|
||||
fi->uninit(ret);
|
||||
av_freep(&ret->name);
|
||||
av_freep(&ret->inputs);
|
||||
av_freep(&ret->input_pads);
|
||||
ret->nb_inputs = 0;
|
||||
|
||||
Reference in New Issue
Block a user