From: Ted Lemon Date: Mon, 12 Feb 2001 19:37:03 +0000 (+0000) Subject: Fix a gnarly memory allocation bug. X-Git-Tag: V3-BETA-2-PATCH-18~82 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=243e51ee8d4f78d02ca9c6b803e655052e35ef14;p=thirdparty%2Fdhcp.git Fix a gnarly memory allocation bug. --- diff --git a/client/clparse.c b/client/clparse.c index fed201efb..cc0c6e732 100644 --- a/client/clparse.c +++ b/client/clparse.c @@ -43,7 +43,7 @@ #ifndef lint static char copyright[] = -"$Id: clparse.c,v 1.54 2001/01/25 08:17:17 mellon Exp $ Copyright (c) 1996-2000 The Internet Software Consortium. All rights reserved.\n"; +"$Id: clparse.c,v 1.55 2001/02/12 19:37:03 mellon Exp $ Copyright (c) 1996-2000 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -591,8 +591,9 @@ void parse_option_list (cfile, list) skip_to_semi (cfile); return; } - if (*list) - dfree (*list, MDL); + /* XXX we can't free the list here, because we may have copied + XXX it from an outer config state. */ + *list = (u_int32_t *)0; if (ix) { *list = dmalloc ((ix + 1) * sizeof **list, MDL); if (!*list) @@ -1020,8 +1021,8 @@ void parse_string_list (cfile, lp, multiple) } tmp = ((struct string_list *) - dmalloc (strlen (val) + 1 + - sizeof (struct string_list *), MDL)); + dmalloc (strlen (val) + sizeof (struct string_list), + MDL)); if (!tmp) log_fatal ("no memory for string list entry.");