From: Christian Brauner Date: Mon, 29 Mar 2021 10:13:43 +0000 (+0200) Subject: confile: cleanup set_config_net_hwaddr() X-Git-Tag: lxc-5.0.0~232^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a8b7aefc156d5e57d5b7b6faa0d7e7e231dba96b;p=thirdparty%2Flxc.git confile: cleanup set_config_net_hwaddr() Signed-off-by: Christian Brauner --- diff --git a/src/lxc/confile.c b/src/lxc/confile.c index 35c65b99d..ff4728c9e 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -660,16 +660,15 @@ static int set_config_net_hwaddr(const char *key, const char *value, if (!netdev) return ret_errno(EINVAL); + clr_config_net_hwaddr(key, lxc_conf, data); if (lxc_config_value_empty(value)) - return clr_config_net_hwaddr(key, lxc_conf, data); + return 0; new_value = strdup(value); if (!new_value) return ret_errno(ENOMEM); rand_complete_hwaddr(new_value); - - free_disarm(netdev->hwaddr); if (!lxc_config_value_empty(new_value)) netdev->hwaddr = move_ptr(new_value);