diff options
author | Marc TITINGER <marc.titinger@non.se.com> | 2021-10-20 16:40:34 +0200 |
---|---|---|
committer | Saya Sugiura <39760799+ssugiura@users.noreply.github.com> | 2021-10-21 08:42:09 +0900 |
commit | 1f51eab36c363041bc18ed194500e8dae9a8aeed (patch) | |
tree | 3e16f988ac932ba0d12022b22a1c3c3a683fb7ee /src | |
parent | d2214ac5075c56ba2bbd7f33f16171e1bad6fa48 (diff) | |
download | DLT-daemon-1f51eab36c363041bc18ed194500e8dae9a8aeed.tar.gz |
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 <marc.titinger@non.se.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/system/dlt-system-options.c | 4 |
1 files 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 +} |