1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-10 06:10:52 +02:00

avfilter/graphparser: Use av_freep(), avoid leaving stale pointers in memory

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer
2014-11-22 18:44:35 +01:00
parent 7df2981f04
commit 9146a47600

View File

@@ -241,8 +241,8 @@ static int link_filter_inouts(AVFilterContext *filt_ctx,
if (p->filter_ctx) { if (p->filter_ctx) {
ret = link_filter(p->filter_ctx, p->pad_idx, filt_ctx, pad, log_ctx); ret = link_filter(p->filter_ctx, p->pad_idx, filt_ctx, pad, log_ctx);
av_free(p->name); av_freep(&p->name);
av_free(p); av_freep(&p);
if (ret < 0) if (ret < 0)
return ret; return ret;
} else { } else {
@@ -344,10 +344,10 @@ static int parse_outputs(const char **buf, AVFilterInOut **curr_inputs,
av_free(name); av_free(name);
return ret; return ret;
} }
av_free(match->name); av_freep(&match->name);
av_free(name); av_freep(&name);
av_free(match); av_freep(&match);
av_free(input); av_freep(&input);
} else { } else {
/* Not in the list, so add the first input as a open_output */ /* Not in the list, so add the first input as a open_output */
input->name = name; input->name = name;