From 9410f94e6a92a5f9f0aefb3565ae887e3f7d9302 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 19 Nov 2015 23:40:19 +0100 Subject: fix issue #4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/malloc.c | 2 ++ 1 file changed, 2 insertions(+) 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; -- cgit v1.2.3-70-g09d2