]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Don't try to zero an allocated buffer if we didn't succeed in allocating it.
authorTed Lemon <source@isc.org>
Tue, 24 Nov 1998 22:17:15 +0000 (22:17 +0000)
committerTed Lemon <source@isc.org>
Tue, 24 Nov 1998 22:17:15 +0000 (22:17 +0000)
common/alloc.c

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