diff options
Diffstat (limited to 'libc')
-rw-r--r-- | libc/stdlib/malloc-simple/alloc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libc/stdlib/malloc-simple/alloc.c b/libc/stdlib/malloc-simple/alloc.c index 630f4c8c8..a4c06d75c 100644 --- a/libc/stdlib/malloc-simple/alloc.c +++ b/libc/stdlib/malloc-simple/alloc.c @@ -67,12 +67,13 @@ void *calloc(size_t num, size_t size) void *malloc(size_t size) { + void *result; #if 1 /* Some programs will call malloc (0). Lets be strict and return NULL */ if (size == 0) return NULL; #endif - void *result = mmap((void *) 0, size, PROT_READ | PROT_WRITE, + result = mmap((void *) 0, size, PROT_READ | PROT_WRITE, #ifdef __UCLIBC_HAS_MMU__ MAP_PRIVATE | MAP_ANONYMOUS, 0, 0 #else |