Skip to contentSkip to conversation

malloc: sbrk() should return MORECORE_FAILURE instead of NULL on failure

PATCH New karl.beldan at gmail.com 2 participants 2 messages Apr 6, 2010 – Apr 9, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 malloc: sbrk() should return MORECORE_FAILURE instead of NULL on failure

---
 common/dlmalloc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
common/dlmalloc.c +1 -1
index 205fc40..2276532 100644
@@ -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;
 
Signature · 1 line
1.7.0.2.323.g0d092
#1 lore raw

PATCH 1/1 malloc: sbrk() should return MORECORE_FAILURE instead of NULL on failure

Dear karl.beldan at gmail.com,

Quoted 4 lines · In message <[email protected]> you wrote:
---
 common/dlmalloc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
miracle:  an  extremely  outstanding  or  unusual  event,  thing,  or
accomplishment.                                - Webster's Dictionary