1
mirror of https://github.com/mpv-player/mpv synced 2024-11-18 21:16:10 +01:00

m_option: fix leaks with OPT_KEYVALUELIST options

For example, specifying --script-opts multiple times could leak some
data.
This commit is contained in:
wm4 2017-06-08 21:12:18 +02:00
parent 289b11553b
commit 79dc1834f5

View File

@ -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;
}