]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
pullup:
authorMark Andrews <marka@isc.org>
Wed, 23 Jan 2002 03:09:31 +0000 (03:09 +0000)
committerMark Andrews <marka@isc.org>
Wed, 23 Jan 2002 03:09:31 +0000 (03:09 +0000)
1189.   [bug]           On some systems, malloc(0) returns NULL, which
                        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 46d1fe59f6bff91918f5c82adc8fd92b5abe347b..5aca51980d10603b3f783e819e8faf71b4f48411 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]
+
 1186.   [bug]           isc_hex_tobuffer(,,length = 0) failed to unget the
                         EOL token when reading to end of line.
 
index b60e0ab8a55e83ba154f4f1c5d815705e0b53eac..24814e8f20ed76d98708c58a21b3147b3170b4df 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: mem.c,v 1.98.2.2 2001/10/12 01:17:37 marka Exp $ */
+/* $Id: mem.c,v 1.98.2.3 2002/01/23 03:09:31 marka Exp $ */
 
 #include <config.h>
 
@@ -664,6 +664,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));
 }