From d6eca24027daa2a379f6bd2c0f50093a08d4df1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= Date: Thu, 5 Dec 2013 17:13:18 -0500 Subject: [PATCH] conffile.c: Also clear text entries with no value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Graber Acked-by: Serge E. Hallyn --- src/lxc/confile.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) {