malloc could leak memory

Alexandre Oliva aoliva@redhat.com
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: <http://sourceware.org/pipermail/newlib/attachments/20020413/08284363/attachment.bin>
-------------- next part --------------

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer


More information about the Newlib mailing list