]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
1189. [bug] On some systems, malloc(0) returns NULL, which
authorBrian Wellington <source@isc.org>
Tue, 22 Jan 2002 15:40:24 +0000 (15:40 +0000)
committerBrian Wellington <source@isc.org>
Tue, 22 Jan 2002 15:40:24 +0000 (15:40 +0000)
could cause the caller to report an out of memory
error. [RT #2398]

CHANGES
lib/isc/mem.c

diff --git a/CHANGES b/CHANGES
index a89ea5f16b21ed6d0ffd00529f39217e950a7579..6797b52f2466b80a7aedc452b4626efb99907f61 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+1189.  [bug]           On some systems, malloc(0) returns NULL, which
+                       could cause the caller to report an out of memory
+                       error. [RT #2398]
+
 1188.  [bug]           Dynamic updates of a signed zone would fail if
                        some of the zone private keys were unavailable.
 
index 2d7c650f90a7bcce6d7a830071bf5e47c22f2b10..cff7ec6218f2445a40b370cbd6a0d8f7de47d4b7 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: mem.c,v 1.109 2001/12/05 19:13:26 bwelling Exp $ */
+/* $Id: mem.c,v 1.110 2002/01/22 15:40:24 bwelling Exp $ */
 
 #include <config.h>
 
@@ -680,6 +680,8 @@ mem_putstats(isc_mem_t *ctx, void *ptr, size_t size) {
 static void *
 default_memalloc(void *arg, size_t size) {
        UNUSED(arg);
+       if (size == 0)
+               size = 1;
        return (malloc(size));
 }