Commit ffe34437 by Serge Hallyn

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: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com>
parent c7ec3de8
......@@ -971,7 +971,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;
......
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