From a1bcc76e6036e78f25cbb7323c145056cfca9d93 Mon Sep 17 00:00:00 2001
From: Anton Khirnov <anton@khirnov.net>
Date: Thu, 23 Aug 2012 09:18:06 +0200
Subject: [PATCH] cmdutils: fix a memleak when specifying an option twice.

---
 cmdutils.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/cmdutils.c b/cmdutils.c
index 6576eba95cc..4462858aa48 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;
-- 
GitLab