]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
confile: safely clean previous value in set_config_net_ipv6_gateway()
authorChristian Brauner <christian.brauner@ubuntu.com>
Sun, 28 Mar 2021 15:54:26 +0000 (17:54 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Mon, 29 Mar 2021 15:02:42 +0000 (17:02 +0200)
Link: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32610
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/confile.c

index f089c86188a91605d0b9d6d09f32d0370ff5b65d..06f66767745fcb4421be31ae79a367a6d6a8a704 100644 (file)
@@ -847,10 +847,9 @@ static int set_config_net_ipv6_gateway(const char *key, const char *value,
        if (!netdev)
                return ret_errno(EINVAL);
 
+       clr_config_net_ipv6_gateway(key, lxc_conf, data);
        if (lxc_config_value_empty(value))
-               return clr_config_net_ipv6_gateway(key, lxc_conf, data);
-
-       free(netdev->ipv6_gateway);
+               return 0;
 
        if (strequal(value, "auto")) {
                netdev->ipv6_gateway = NULL;