Skip to content

Commit f7e2c24

Browse files
committed
INET: Fix a potential memory leak
When someone deletes the address from under us.
1 parent 69e2b6c commit f7e2c24

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/dhcp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4008,7 +4008,7 @@ dhcp_handleifa(int cmd, struct ipv4_addr *ia, pid_t pid)
40084008
* to drop the lease. */
40094009
dhcp_drop(ifp, "EXPIRE");
40104010
dhcp_start1(ifp);
4011-
return NULL;
4011+
return ia;
40124012
}
40134013
}
40144014

src/ipv4.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,7 @@ ipv4_handleifa(struct dhcpcd_ctx *ctx,
942942
#endif
943943
}
944944

945-
if (cmd == RTM_DELADDR && ia != NULL)
945+
if (cmd == RTM_DELADDR)
946946
free(ia);
947947
}
948948

0 commit comments

Comments
 (0)