conffile.c: Also clear text entries with no value

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
This commit is contained in:
Stéphane Graber 2013-12-05 17:13:18 -05:00
parent 53251299b8
commit d6eca24027

View File

@ -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) {