@@ -32,7 +32,8 @@ void *malloc(size_t size)
size++;
#else
/* Some programs will call malloc (0). Lets be strict and return NULL */
- return 0;
+ __set_errno(ENOMEM);
+ return NULL;
#endif
}
@@ -826,7 +826,10 @@ void* malloc(size_t bytes)
void * retval;
#if !defined(__MALLOC_GLIBC_COMPAT__)
- if (!bytes) return NULL;
+ if (!bytes) {
+ }
__MALLOC_LOCK;
@@ -200,7 +200,7 @@ malloc (size_t size)
if (unlikely (size == 0))
+ goto oom;
/* Check if they are doing something dumb like malloc(-1) */