Pārlūkot izejas kodu

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

Eric Andersen 23 gadi atpakaļ
vecāks
revīzija
3272f0e747
1 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  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