From: Stéphane Graber Date: Thu, 5 Dec 2013 22:13:18 +0000 (-0500) Subject: conffile.c: Also clear text entries with no value X-Git-Tag: lxc-1.0.0.beta1~53 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d6eca24027daa2a379f6bd2c0f50093a08d4df1d;p=thirdparty%2Flxc.git conffile.c: Also clear text entries with no value Signed-off-by: Stéphane Graber Acked-by: Serge E. Hallyn --- diff --git a/src/lxc/confile.c b/src/lxc/confile.c index 835153b86..5f25e08ce 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -216,8 +216,12 @@ static int config_string_item(char **conf_item, const char *value) { char *new_value; - if (!value || strlen(value) == 0) + if (!value || strlen(value) == 0) { + if (*conf_item) + free(*conf_item); + *conf_item = NULL; return 0; + } new_value = strdup(value); if (!new_value) {