From 66886b4d7ebe4ad50c7af0b01000408c8c5d250c Mon Sep 17 00:00:00 2001 From: Paul Dino Jones Date: Wed, 26 Mar 2025 11:56:31 -0400 Subject: [PATCH] fix leak in config --- src/monocoque/helper/confighelper.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/monocoque/helper/confighelper.c b/src/monocoque/helper/confighelper.c index 1f751ac..d8957fd 100644 --- a/src/monocoque/helper/confighelper.c +++ b/src/monocoque/helper/confighelper.c @@ -243,6 +243,7 @@ int getNumberOfConfigs(const char* config_file_str) config = config_lookup(&cfg, "configs"); int configs = config_setting_length(config); + config_destroy(&cfg); return configs; } @@ -898,14 +899,12 @@ int uiloadconfig(const char* config_file_str, int confignum, int configureddevic int settingsfree(DeviceSettings ds) { - - if (ds.dev_subtype == SIMDEVTYPE_SIMWIND || ds.dev_subtype == SIMDEVTYPE_SHIFTLIGHTS || ds.dev_subtype == SIMDEVTYPE_SIMLED) + if (ds.dev_type == SIMDEV_SERIAL) { if (ds.serialdevsettings.portdev != NULL) { free(ds.serialdevsettings.portdev); } - } if (ds.dev_type == SIMDEV_SOUND) {