summaryrefslogtreecommitdiff
path: root/libc/stdlib
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-04-27 15:32:56 +0000
committerEric Andersen <andersen@codepoet.org>2001-04-27 15:32:56 +0000
commit138e736e54f7edb9164fe2125b3245b28c111761 (patch)
tree4c7ffcd380cdb4acc5788e5d5460c85fa61e03e1 /libc/stdlib
parent12d25537ed944ddac65cbc9e67f39cc61c0e3e03 (diff)
Patch from Tom Walsh <tom@cyberiansoftware.com> to fix a thinko
on my patch.
Diffstat (limited to 'libc/stdlib')
-rw-r--r--libc/stdlib/malloc-simple/alloc.c3
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