OSDN Git Service

add support for __MALLOC_GLIBC_COMPAT__ (malloc(0) == NULL) so the malloc test wont...
authorMike Frysinger <vapier@gentoo.org>
Wed, 6 Jul 2005 01:23:08 +0000 (01:23 -0000)
committerMike Frysinger <vapier@gentoo.org>
Wed, 6 Jul 2005 01:23:08 +0000 (01:23 -0000)
libc/stdlib/malloc-standard/malloc.c

index 51e02a2..7025e83 100644 (file)
@@ -827,6 +827,10 @@ void* malloc(size_t bytes)
     mchunkptr       bck;              /* misc temp for linking */
     void *          sysmem;
 
+#if !defined(__MALLOC_GLIBC_COMPAT__)
+    if (!bytes) return NULL;
+#endif
+
     LOCK;
     av = get_malloc_state();
     /*