From 79dc1834f5932b36b0a2b48388654d2c4dcd2817 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 8 Jun 2017 21:12:18 +0200 Subject: m_option: fix leaks with OPT_KEYVALUELIST options For example, specifying --script-opts multiple times could leak some data. --- options/m_option.c | 3 +++ 1 file changed, 3 insertions(+) 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; } -- cgit v1.2.3