cmdutils: fix a memleak when specifying an option twice.
authorAnton Khirnov <anton@khirnov.net>
Thu, 23 Aug 2012 07:18:06 +0000 (09:18 +0200)
committerAnton Khirnov <anton@khirnov.net>
Fri, 24 Aug 2012 09:25:06 +0000 (11:25 +0200)
cmdutils.c

index 6576eba..4462858 100644 (file)
@@ -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;