From: Ted Lemon Date: Tue, 17 Mar 1998 06:08:49 +0000 (+0000) Subject: Don't memset allocated memory if we didn't allocate it. X-Git-Tag: carrel-2~158 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4085b4754fa61c2e838adc9d7d2225e4bd1afd09;p=thirdparty%2Fdhcp.git Don't memset allocated memory if we didn't allocate it. --- diff --git a/common/alloc.c b/common/alloc.c index 172fcea60..5f15f76c3 100644 --- a/common/alloc.c +++ b/common/alloc.c @@ -42,7 +42,7 @@ #ifndef lint static char copyright[] = -"$Id: alloc.c,v 1.13 1997/05/09 07:56:13 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; +"$Id: alloc.c,v 1.14 1998/03/17 06:08:49 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -57,7 +57,8 @@ VOIDPTR dmalloc (size, name) VOIDPTR foo = (VOIDPTR)malloc (size); if (!foo) warn ("No memory for %s.", name); - memset (foo, 0, size); + else + memset (foo, 0, size); return foo; }