diff options
author | wm4 <wm4@nowhere> | 2017-06-08 21:12:18 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2017-06-08 21:51:25 +0200 |
commit | 79dc1834f5932b36b0a2b48388654d2c4dcd2817 (patch) | |
tree | c7cb78719c4a39b90ef3336bfbb85d34a7fbfd08 | |
parent | 289b11553b985ecdc8a91a9beefb376ee86ddc5f (diff) |
m_option: fix leaks with OPT_KEYVALUELIST options
For example, specifying --script-opts multiple times could leak some
data.
-rw-r--r-- | options/m_option.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/options/m_option.c b/options/m_option.c index fa93dd47c7..87e6eead36 100644 --- a/options/m_option.c +++ b/options/m_option.c @@ -1509,9 +1509,12 @@ static int parse_keyvalue_list(struct mp_log *log, const m_option_t *opt, } if (dst) { + free_str_list(dst); VAL(dst) = lst; if (r < 0) free_str_list(dst); + } else { + free_str_list(&lst); } return r; } |