From: Serge Hallyn Date: Tue, 12 Jan 2016 02:25:19 +0000 (-0800) Subject: Set the right variable to NULL when unsetting ipv6_gateway X-Git-Tag: lxc-1.0.9~114 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d06c1c95516af45ebea611058566ef90ebd8226d;p=thirdparty%2Flxc.git Set the right variable to NULL when unsetting ipv6_gateway We were freeing one and setting a different one to NULL, eventually leading to a crash when closing the netdev (at container shutdown) and freeing already-freed memory. Closes #732 Signed-off-by: Serge Hallyn --- diff --git a/src/lxc/confile.c b/src/lxc/confile.c index d418ed22e..56c391d42 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -932,7 +932,7 @@ static int config_network_ipv6_gateway(const char *key, const char *value, free(netdev->ipv6_gateway); if (!value || strlen(value) == 0) { - netdev->ipv4_gateway = NULL; + netdev->ipv6_gateway = NULL; } else if (!strcmp(value, "auto")) { netdev->ipv6_gateway = NULL; netdev->ipv6_gateway_auto = true;