summaryrefslogtreecommitdiff
path: root/libc/stdlib/malloc-standard
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-07-06 01:23:08 +0000
committerMike Frysinger <vapier@gentoo.org>2005-07-06 01:23:08 +0000
commit629ec28ed6473baf96d26fd1d395496c634bc921 (patch)
tree4b3aa76121b4aff1c8eb5c9628619f1c8c8801e6 /libc/stdlib/malloc-standard
parentf934cd05300c0683f78bbeb1d9697bd947df0854 (diff)
add support for __MALLOC_GLIBC_COMPAT__ (malloc(0) == NULL) so the malloc test wont fail
Diffstat (limited to 'libc/stdlib/malloc-standard')
-rw-r--r--libc/stdlib/malloc-standard/malloc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libc/stdlib/malloc-standard/malloc.c b/libc/stdlib/malloc-standard/malloc.c
index 51e02a240..7025e8335 100644
--- a/libc/stdlib/malloc-standard/malloc.c
+++ b/libc/stdlib/malloc-standard/malloc.c
@@ -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();
/*