aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-11-19 23:40:19 +0100
committerMattias Andrée <maandree@operamail.com>2015-11-19 23:40:19 +0100
commit9410f94e6a92a5f9f0aefb3565ae887e3f7d9302 (patch)
tree4a4fc658fb42816a76362c2e76f6ae4769dace5e
parentetymology for some functions (diff)
downloadslibc-9410f94e6a92a5f9f0aefb3565ae887e3f7d9302.tar.gz
slibc-9410f94e6a92a5f9f0aefb3565ae887e3f7d9302.tar.bz2
slibc-9410f94e6a92a5f9f0aefb3565ae887e3f7d9302.tar.xz
fix issue #4
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--src/malloc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/malloc.c b/src/malloc.c
index a3ad430..61ef244 100644
--- a/src/malloc.c
+++ b/src/malloc.c
@@ -65,6 +65,8 @@ static void* unaligned_malloc(size_t size)
ptr = mmap(NULL, full_size, (PROT_READ | PROT_WRITE),
(MAP_PRIVATE | MAP_ANONYMOUS), -1, 0);
+ if (ptr == MAP_FAILED)
+ return NULL;
((size_t*)ptr)[0] = size;
((size_t*)ptr)[1] = 0;