From: Ted Lemon Date: Wed, 2 May 2001 07:09:36 +0000 (+0000) Subject: Don't free null uid buffers. X-Git-Tag: V3-RC5~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4d1a48ebef16903e475c979a8580cb5cd253ea24;p=thirdparty%2Fdhcp.git Don't free null uid buffers. --- diff --git a/server/mdb.c b/server/mdb.c index 447838c7c..7c3c1db04 100644 --- a/server/mdb.c +++ b/server/mdb.c @@ -43,7 +43,7 @@ #ifndef lint static char copyright[] = -"$Id: mdb.c,v 1.66 2001/04/30 22:38:34 mellon Exp $ Copyright (c) 1996-2000 The Internet Software Consortium. All rights reserved.\n"; +"$Id: mdb.c,v 1.67 2001/05/02 07:09:36 mellon Exp $ Copyright (c) 1996-2000 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -1376,7 +1376,7 @@ void abandon_lease (lease, message) log_error ("Abandoning IP address %s: %s", piaddr (lease -> ip_addr), message); lt -> hardware_addr.hlen = 0; - if (lt -> uid != lt -> uid_buf) + if (lt -> uid && lt -> uid != lt -> uid_buf) dfree (lt -> uid, MDL); lt -> uid = (unsigned char *)0; lt -> uid_len = 0; @@ -1407,7 +1407,7 @@ void dissociate_lease (lease) #endif lt -> ends = cur_time; /* XXX */ lt -> hardware_addr.hlen = 0; - if (lt -> uid != lt -> uid_buf) + if (lt -> uid && lt -> uid != lt -> uid_buf) dfree (lt -> uid, MDL); lt -> uid = (unsigned char *)0; lt -> uid_len = 0;