diff --git a/usr/klibc/malloc.c b/usr/klibc/malloc.c index 413b7337..bb57c9f6 100644 --- a/usr/klibc/malloc.c +++ b/usr/klibc/malloc.c @@ -8,6 +8,7 @@ #include #include #include +#include #include "malloc.h" /* Both the arena list and the free memory list are double linked @@ -169,6 +170,7 @@ void *malloc(size_t size) #endif if (fp == (struct free_arena_header *)MAP_FAILED) { + errno = ENOMEM; return NULL; /* Failed to get a block */ }