From: Ted Lemon Date: Tue, 24 Nov 1998 22:17:15 +0000 (+0000) Subject: Don't try to zero an allocated buffer if we didn't succeed in allocating it. X-Git-Tag: V2-BETA-1-PATCH-7~43 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6b87e215504a2d93396e2a6f31a973916e736825;p=thirdparty%2Fdhcp.git Don't try to zero an allocated buffer if we didn't succeed in allocating it. --- diff --git a/common/alloc.c b/common/alloc.c index 172fcea60..a9584622a 100644 --- a/common/alloc.c +++ b/common/alloc.c @@ -3,7 +3,7 @@ Memory allocation... */ /* - * Copyright (c) 1995, 1996 The Internet Software Consortium. + * Copyright (c) 1995, 1996, 1998 The Internet Software Consortium. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -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.13.2.1 1998/11/24 22:17:15 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; }