Explorar o código

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

Eric Andersen %!s(int64=23) %!d(string=hai) anos
pai
achega
3272f0e747
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  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