malloc could leak memory

Alexandre Oliva
Sat Apr 13 03:26:00 GMT 2002

In the unlikely case of failure of the sbrk() that attempts to align
the sbrk to a page boundary, we'd leak the whole chunk of memory
previously allocated.  This patch corrects this problem, by leaving
the top of the heap misaligned and attempting to correct it next
time.  I'm checking this in, approved by Jeff Johnston.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: newlib-malloc-sbrk-failure.patch
Type: text/x-patch
Size: 2283 bytes
Desc: not available
URL: <>
-------------- next part --------------

Alexandre Oliva   Enjoy Guarana', see
Red Hat GCC Developer                  aoliva@{,}
CS PhD student at IC-Unicamp        oliva@{,}
Free Software Evangelist                Professional serial bug killer

More information about the Newlib mailing list