diff options
author | Mattias Andrée <maandree@operamail.com> | 2015-11-19 23:40:19 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2015-11-19 23:40:19 +0100 |
commit | 9410f94e6a92a5f9f0aefb3565ae887e3f7d9302 (patch) | |
tree | 4a4fc658fb42816a76362c2e76f6ae4769dace5e /src | |
parent | etymology for some functions (diff) | |
download | slibc-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 'src')
-rw-r--r-- | src/malloc.c | 2 |
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; |