diff --git a/cmdutils.c b/cmdutils.c index 6576eba95c..4462858aa4 100644 --- a/cmdutils.c +++ b/cmdutils.c @@ -271,6 +271,7 @@ int parse_option(void *optctx, const char *opt, const char *arg, if (po->flags & OPT_STRING) { char *str; str = av_strdup(arg); + av_freep(dst); *(char **)dst = str; } else if (po->flags & OPT_BOOL) { *(int *)dst = bool_val;