From 1f51eab36c363041bc18ed194500e8dae9a8aeed Mon Sep 17 00:00:00 2001 From: Marc TITINGER Date: Wed, 20 Oct 2021 16:40:34 +0200 Subject: dlt-system : fix invalid free with ConfigurationFileName when using default const string. this location is free()'ed in the cleanup routine, leading to bugcheck upon exit. Use strdup to allocate memory, that can be free()'ed. Signed-off-by: Marc TITINGER --- src/system/dlt-system-options.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/system/dlt-system-options.c b/src/system/dlt-system-options.c index 8b8e681..69024d1 100644 --- a/src/system/dlt-system-options.c +++ b/src/system/dlt-system-options.c @@ -81,7 +81,7 @@ void usage(char *prog_name) */ void init_cli_options(DltSystemCliOptions *options) { - options->ConfigurationFileName = DEFAULT_CONF_FILE; + options->ConfigurationFileName = strdup(DEFAULT_CONF_FILE); options->Daemonize = 0; } @@ -470,4 +470,4 @@ void cleanup_config(DltSystemConfiguration *config, DltSystemCliOptions *options config->LogProcesses.Name[i] = NULL; } } -} \ No newline at end of file +} -- cgit v1.2.1