summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/configreader.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/configreader.h b/include/configreader.h
index 222195727..6db8f03dc 100644
--- a/include/configreader.h
+++ b/include/configreader.h
@@ -140,6 +140,11 @@ template<> class ValueContainer<char **> : public ValueContainerBase
/** Change value to type T of size s */
void Set(const char *newval, size_t s)
{
+ if (*val) delete [] *val;
+ if (!*newval) {
+ *val = NULL;
+ return;
+ }
*val = new char[s];
strlcpy(*val, newval, s);
}