confile: config_utsname()

parent 355c5701
...@@ -2233,8 +2233,10 @@ static int config_utsname(const char *key, const char *value, ...@@ -2233,8 +2233,10 @@ static int config_utsname(const char *key, const char *value,
{ {
struct utsname *utsname; struct utsname *utsname;
if (config_value_empty(value)) if (config_value_empty(value)) {
lxc_clear_config_item(lxc_conf, key);
return 0; return 0;
}
utsname = malloc(sizeof(*utsname)); utsname = malloc(sizeof(*utsname));
if (!utsname) { if (!utsname) {
...@@ -2243,8 +2245,7 @@ static int config_utsname(const char *key, const char *value, ...@@ -2243,8 +2245,7 @@ static int config_utsname(const char *key, const char *value,
} }
if (strlen(value) >= sizeof(utsname->nodename)) { if (strlen(value) >= sizeof(utsname->nodename)) {
ERROR("node name '%s' is too long", ERROR("node name '%s' is too long", value);
value);
free(utsname); free(utsname);
return -1; return -1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment