From 0cf75082527cca1b69c7a64f5ce599afeb8b1e44 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Thu, 11 May 2023 16:21:09 -0700 Subject: til_settings: free nested settings til_settings_free() needs to recur on nested settings --- src/til_settings.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/til_settings.c b/src/til_settings.c index e363466..2c3d3be 100644 --- a/src/til_settings.c +++ b/src/til_settings.c @@ -185,6 +185,9 @@ til_settings_t * til_settings_free(til_settings_t *settings) if (settings) { for (unsigned i = 0; i < settings->num; i++) { + if (settings->entries[i]->value_as_nested_settings) + til_settings_free(settings->entries[i]->value_as_nested_settings); + free((void *)settings->entries[i]->key); free((void *)settings->entries[i]->value); til_setting_desc_free((void *)settings->entries[i]->desc); -- cgit v1.2.3