Browse Source

Be more strict with the glibc style malloc implementation. Return NULL
when folks do a malloc(0) using malloc-930716.

Eric Andersen 23 years ago
parent
commit
3272f0e747
1 changed files with 2 additions and 2 deletions
  1. 2 2
      libc/stdlib/malloc-930716/malloc.c

+ 2 - 2
libc/stdlib/malloc-930716/malloc.c

@@ -127,8 +127,8 @@ malloc (size_t size)
     if (!initialized && !initialize())
 	return NULL;
 
-    /* Some programs will call malloc (0). We let them pass. */
-#if 0
+#if 1
+    /* Some programs will call malloc (0).  Lets be strict and return NULL */
     if (size == 0)
 	return NULL;
 #endif