malloc: sbrk() should return MORECORE_FAILURE instead of NULL on failure
authorkarl.beldan@gmail.com <karl.beldan@gmail.com>
Tue, 6 Apr 2010 20:18:08 +0000 (22:18 +0200)
committerWolfgang Denk <wd@denx.de>
Fri, 9 Apr 2010 22:30:27 +0000 (00:30 +0200)
Signed-off-by: Karl Beldan <karl.beldan@gmail.com>
common/dlmalloc.c

index 205fc40ac83d866a7581ab28a9793093512bde40..2276532da7a8441c500c39b1716e23a2806a8c21 100644 (file)
@@ -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;