mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-04 07:34:19 +00:00
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:
parent
53251299b8
commit
d6eca24027
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user