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 : 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); }