]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Don't memset allocated memory if we didn't allocate it.
authorTed Lemon <source@isc.org>
Tue, 17 Mar 1998 06:08:49 +0000 (06:08 +0000)
committerTed Lemon <source@isc.org>
Tue, 17 Mar 1998 06:08:49 +0000 (06:08 +0000)
common/alloc.c

index 172fcea606dd7486d38af3d054d360a200e6039b..5f15f76c3d47909bdc6952cb89a6d2bb27b74343 100644 (file)
@@ -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;
 }