From 1d7421dcefabb35c91f7b7d51521c88831af6b90 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Sat, 29 Jan 2005 16:29:10 +0000 Subject: Fix memory leak when supersede_lease() fails and it is a DHCPACK or a dynamic BOOTREPLY offer. OK claudio@ --- usr.sbin/dhcpd/dhcp.c | 6 ++++-- 1 file 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, <, !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. */ -- cgit v1.2.3