From 207aa647a52632b29d6a98876151c113c494c6b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Sat, 2 Nov 2024 03:08:07 +0100 Subject: [PATCH] options/m_option: free all list elements when removing them Elements are not parented to the add list, as they are directly copied to the target list. Therefore, we need to clean them up manually. Fixes: 1f5a67d8fae69ebc19d1655035676ee66e22b0aa --- options/m_option.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/options/m_option.c b/options/m_option.c index 00b9c49726..76f7694abe 100644 --- a/options/m_option.c +++ b/options/m_option.c @@ -1319,6 +1319,8 @@ static int str_list_add(char **add, int n, void *dst, int pre) #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION if (ln >= 100) { + while (n--) + talloc_free(add[n]); talloc_free(add); return 0; }