aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavfilter/graphparser.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavfilter/graphparser.c b/libavfilter/graphparser.c
index d92b5360a6..dfb94788e1 100644
--- a/libavfilter/graphparser.c
+++ b/libavfilter/graphparser.c
@@ -303,8 +303,10 @@ static int parse_inputs(const char **buf, AVFilterInOut **curr_inputs,
char *name = parse_link_name(buf, log_ctx);
AVFilterInOut *match;
- if (!name)
+ if (!name) {
+ avfilter_inout_free(&parsed_inputs);
return AVERROR(EINVAL);
+ }
/* First check if the label is not in the open_outputs list */
match = extract_inout(name, open_outputs);
@@ -314,6 +316,7 @@ static int parse_inputs(const char **buf, AVFilterInOut **curr_inputs,
} else {
/* Not in the list, so add it as an input */
if (!(match = av_mallocz(sizeof(AVFilterInOut)))) {
+ avfilter_inout_free(&parsed_inputs);
av_free(name);
return AVERROR(ENOMEM);
}