diff --git a/common/dlmalloc.c b/common/dlmalloc.c
index 205fc40ac83d866a7581ab28a9793093512bde40..2276532da7a8441c500c39b1716e23a2806a8c21 100644
--- a/common/dlmalloc.c
+++ b/common/dlmalloc.c
@@ -1515,7 +1515,7 @@ void *sbrk(ptrdiff_t increment)
 	ulong new = old + increment;
 
 	if ((new < mem_malloc_start) || (new > mem_malloc_end))
-		return NULL;
+		return (void *)MORECORE_FAILURE;
 
 	mem_malloc_brk = new;