From bcb917fa0828e41c8bdf687a919c55ccee347fd3 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Tue, 22 Oct 2019 22:50:17 +0100 Subject: [PATCH] INET: If we fail to add an address that already exists, don't free it Should not happen in production..... --- src/ipv4.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ipv4.c b/src/ipv4.c index c55a7da6..f16b2a1f 100644 --- a/src/ipv4.c +++ b/src/ipv4.c @@ -687,7 +687,8 @@ ipv4_addaddr(struct interface *ifp, const struct in_addr *addr, if (errno != EEXIST) logerr("%s: if_addaddress", __func__); - free(ia); + if (ia->flags & IPV4_AF_NEW) + free(ia); return NULL; } -- 2.47.2