From b1933441456f40ba8da170fe520b870370a55917 Mon Sep 17 00:00:00 2001 From: Arjan van de Ven Date: Fri, 12 May 2017 09:52:36 +0000 Subject: [PATCH] Make sure to strdup() the ini file keys --- src/configuration.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/configuration.c b/src/configuration.c index a0bc01d..3e3d767 100644 --- a/src/configuration.c +++ b/src/configuration.c @@ -97,7 +97,7 @@ bool read_config_from_file(char *config_file, struct configuration *config) return false; } else { for (int i = CONF_STR_MIN + 1; i < CONF_STR_MAX; i++) { - config->strValues[i] = nc_hashmap_get(nc_hashmap_get(keyfile, "settings"), config_key_str[i]); + config->strValues[i] = strdup(nc_hashmap_get(nc_hashmap_get(keyfile, "settings"), config_key_str[i])); fprintf(stderr, "Looking for %s found %s \n", config_key_str[i], config->strValues[i]); if (config->strValues[i] == NULL) { return false;