summaryrefslogtreecommitdiff
path: root/cmdutils.c
diff options
context:
space:
mode:
authorClément Bœsch <clement.boesch@smartjog.com>2012-11-15 17:11:04 +0200
committerClément Bœsch <ubitux@gmail.com>2013-03-13 07:25:16 +0100
commit19c41c6d8ef6cc34cfde6bf877e059689e763bb7 (patch)
treea3b06db50a8749b5e8acbefb79bb80fa7445c188 /cmdutils.c
parent12fe78a77bf5c2f7e31dcdd0fa4c40d8dc11c762 (diff)
opt: re-enable memleak fix for duplicated options.
The memleak fix in a1bcc76e was causing problems when the original string wasn't NULL or av_malloc'ed, thus was disabled. It seems the only OPT_STRING occurence where it needed to be fixed is in ffserver. This commit fixes that specific problem and so re-enable the original code.
Diffstat (limited to 'cmdutils.c')
-rw-r--r--cmdutils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmdutils.c b/cmdutils.c
index 8b8eacc3b1..ca1c965edc 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -278,7 +278,7 @@ static int write_option(void *optctx, const OptionDef *po, const char *opt,
if (po->flags & OPT_STRING) {
char *str;
str = av_strdup(arg);
-// av_freep(dst);
+ av_freep(dst);
*(char **)dst = str;
} else if (po->flags & OPT_BOOL || po->flags & OPT_INT) {
*(int *)dst = parse_number_or_die(opt, arg, OPT_INT64, INT_MIN, INT_MAX);