summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2023-05-11 16:21:09 -0700
committerVito Caputo <vcaputo@pengaru.com>2023-05-11 16:23:56 -0700
commit0cf75082527cca1b69c7a64f5ce599afeb8b1e44 (patch)
treefb940553c38efea2fd80e3443a0fc60750af1674
parente59f16f1bb9e20bc72f94f001d410a81806ecdba (diff)
til_settings: free nested settings
til_settings_free() needs to recur on nested settings
-rw-r--r--src/til_settings.c3
1 files changed, 3 insertions, 0 deletions
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);
© All Rights Reserved