confile: safely clean previous value in set_config_net_ipv4_gateway()

parent ed3a03cb
...@@ -698,10 +698,9 @@ static int set_config_net_ipv4_gateway(const char *key, const char *value, ...@@ -698,10 +698,9 @@ static int set_config_net_ipv4_gateway(const char *key, const char *value,
if (!netdev) if (!netdev)
return ret_errno(EINVAL); return ret_errno(EINVAL);
clr_config_net_ipv4_gateway(key, lxc_conf, data);
if (lxc_config_value_empty(value)) if (lxc_config_value_empty(value))
return clr_config_net_ipv4_gateway(key, lxc_conf, data); return 0;
free(netdev->ipv4_gateway);
if (strequal(value, "auto")) { if (strequal(value, "auto")) {
netdev->ipv4_gateway = NULL; netdev->ipv4_gateway = NULL;
......
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