From 9fe3814a2ef0be8e5b693fb0fa42064b33d0ae45 Mon Sep 17 00:00:00 2001 From: Thomas Vanbesien Date: Wed, 18 Feb 2026 10:00:46 +0100 Subject: Fix memory leak, add volatile, reduce duplication - config.c: free partial strdup on configAppend failure - common.c: consolidate loadTrustStore error paths with goto - server_lds.c, server_register.c: make running volatile, remove non-async-signal-safe call from signal handler - server_register.c: extract LdsClientParams + makeLdsClientConfig to deduplicate the register/deregister client config setup --- src/config.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/config.c') diff --git a/src/config.c b/src/config.c index 2165821..258d167 100644 --- a/src/config.c +++ b/src/config.c @@ -68,6 +68,8 @@ configAppend (Config *cfg, const char *key, const char *value) cfg->entries[cfg->count].value = strdup (value); if (!cfg->entries[cfg->count].key || !cfg->entries[cfg->count].value) { + free (cfg->entries[cfg->count].key); + free (cfg->entries[cfg->count].value); UA_LOG_ERROR (UA_Log_Stdout, UA_LOGCATEGORY_USERLAND, "Config: out of memory"); return -1; -- cgit v1.2.3