From ae30b8c200dc071d719ad649d0bf5635d61754f3 Mon Sep 17 00:00:00 2001
From: "karl.beldan@gmail.com" <karl.beldan@gmail.com>
Date: Tue, 6 Apr 2010 22:18:08 +0200
Subject: [PATCH] malloc: sbrk() should return MORECORE_FAILURE instead of NULL
 on failure

Signed-off-by: Karl Beldan <karl.beldan@gmail.com>
---
 common/dlmalloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/dlmalloc.c b/common/dlmalloc.c
index 205fc40ac8..2276532da7 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;
 
-- 
2.39.5