From: Roy Marples Date: Tue, 22 Oct 2019 21:50:17 +0000 (+0100) Subject: INET: If we fail to add an address that already exists, don't free it X-Git-Tag: v8.1.2~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bcb917fa0828e41c8bdf687a919c55ccee347fd3;p=thirdparty%2Fdhcpcd.git INET: If we fail to add an address that already exists, don't free it Should not happen in production..... --- 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; }