From fef2de1075e1a294de3675dbd1f71a073e6ae49d Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 10 Jun 2012 00:42:46 +0000 Subject: [PATCH] -slightly better in case free/strdup'd value is aliased --- src/util/configuration.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/util/configuration.c b/src/util/configuration.c index 308672fbe..194388fa0 100644 --- a/src/util/configuration.c +++ b/src/util/configuration.c @@ -632,12 +632,14 @@ GNUNET_CONFIGURATION_set_value_string (struct GNUNET_CONFIGURATION_Handle *cfg, { struct ConfigSection *sec; struct ConfigEntry *e; + char *nv; e = findEntry (cfg, section, option); if (e != NULL) { + nv = GNUNET_strdup (value); GNUNET_free_non_null (e->val); - e->val = GNUNET_strdup (value); + e->val = nv; return; } sec = findSection (cfg, section); -- 2.25.1