summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2005-01-29 16:29:10 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2005-01-29 16:29:10 +0000
commit1d7421dcefabb35c91f7b7d51521c88831af6b90 (patch)
tree99816cff56f2d65139092f57140287b5aff96327 /usr.sbin
parent2cb9c3c71b17346a9074ecde8ae66bd3f6278bd6 (diff)
Fix memory leak when supersede_lease() fails and it is a DHCPACK
or a dynamic BOOTREPLY offer. OK claudio@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/dhcpd/dhcp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/dhcpd/dhcp.c b/usr.sbin/dhcpd/dhcp.c
index b25a2014160..e8533de5268 100644
--- a/usr.sbin/dhcpd/dhcp.c
+++ b/usr.sbin/dhcpd/dhcp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhcp.c,v 1.16 2004/12/06 17:18:35 claudio Exp $ */
+/* $OpenBSD: dhcp.c,v 1.17 2005/01/29 16:29:09 millert Exp $ */
/*
* Copyright (c) 1995, 1996, 1997, 1998, 1999
@@ -804,8 +804,10 @@ ack_lease(struct packet *packet, struct lease *lease, unsigned int offer,
it) either. */
if (!(supersede_lease(lease, &lt, !offer || offer == DHCPACK) ||
- (offer && offer != DHCPACK)))
+ (offer && offer != DHCPACK))) {
+ free_lease_state(state, "ack_lease: !supersede_lease");
return;
+ }
}
/* Remember the interface on which the packet arrived. */