summaryrefslogtreecommitdiffstats
path: root/options
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-06-08 21:12:18 +0200
committerwm4 <wm4@nowhere>2017-06-08 21:51:25 +0200
commit79dc1834f5932b36b0a2b48388654d2c4dcd2817 (patch)
treec7cb78719c4a39b90ef3336bfbb85d34a7fbfd08 /options
parent289b11553b985ecdc8a91a9beefb376ee86ddc5f (diff)
downloadmpv-79dc1834f5932b36b0a2b48388654d2c4dcd2817.tar.bz2
mpv-79dc1834f5932b36b0a2b48388654d2c4dcd2817.tar.xz
m_option: fix leaks with OPT_KEYVALUELIST options
For example, specifying --script-opts multiple times could leak some data.
Diffstat (limited to 'options')
-rw-r--r--options/m_option.c3
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;
}