diff options
| author | Thomas Vanbesien <tvanbesi@proton.me> | 2026-02-18 10:00:46 +0100 |
|---|---|---|
| committer | Thomas Vanbesien <tvanbesi@proton.me> | 2026-02-18 10:00:46 +0100 |
| commit | 9fe3814a2ef0be8e5b693fb0fa42064b33d0ae45 (patch) | |
| tree | e43b252b9d6b8ed026b6aeacf61a0e5d5aef1187 /src/config.c | |
| parent | 8d9ca6e1e18d8b429c30e3e30828bb41c6b26c5c (diff) | |
| download | BobinkCOpcUa-9fe3814a2ef0be8e5b693fb0fa42064b33d0ae45.tar.gz BobinkCOpcUa-9fe3814a2ef0be8e5b693fb0fa42064b33d0ae45.zip | |
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
Diffstat (limited to 'src/config.c')
| -rw-r--r-- | src/config.c | 2 |
1 files changed, 2 insertions, 0 deletions
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; |
