Unverified Commit 71162625 by Christian Brauner Committed by Stéphane Graber

confile: config_utsname()

parent 21304bdd
...@@ -2045,8 +2045,10 @@ static int config_utsname(const char *key, const char *value, ...@@ -2045,8 +2045,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) {
...@@ -2055,8 +2057,7 @@ static int config_utsname(const char *key, const char *value, ...@@ -2055,8 +2057,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