From: Roy Marples Date: Wed, 23 Oct 2019 10:21:38 +0000 (+0100) Subject: INET: Fix a potential memory leak X-Git-Tag: v8.1.2~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=75f0170ac1c2762ec532a0cfa6fab9a409e4d069;p=thirdparty%2Fdhcpcd.git INET: Fix a potential memory leak When someone deletes the address from under us. --- diff --git a/src/dhcp.c b/src/dhcp.c index fb346299..65c81f6d 100644 --- a/src/dhcp.c +++ b/src/dhcp.c @@ -4008,7 +4008,7 @@ dhcp_handleifa(int cmd, struct ipv4_addr *ia, pid_t pid) * to drop the lease. */ dhcp_drop(ifp, "EXPIRE"); dhcp_start1(ifp); - return NULL; + return ia; } } diff --git a/src/ipv4.c b/src/ipv4.c index f16b2a1f..fd2a15d7 100644 --- a/src/ipv4.c +++ b/src/ipv4.c @@ -942,7 +942,7 @@ ipv4_handleifa(struct dhcpcd_ctx *ctx, #endif } - if (cmd == RTM_DELADDR && ia != NULL) + if (cmd == RTM_DELADDR) free(ia); }