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:
parent
289b11553b
commit
79dc1834f5
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user