This is the mail archive of the newlib@sources.redhat.com mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: asprintf in low memory situations


Thomas Rauscher wrote:
Hi,

it seems that NEWLIB's asprintf does not
free an allocated buffer in fp->_bf._base
when a call to _realloc_r() fails.

This is somewhat different to the BSD and GLIBC
implementation. BSD LIBC seems to call free() and set the return pointer to NULL while GLIBC (according to man page) seems to call free()
and return the now invalid pointer.


I'm just curious whether this is a design issue or a bug.

It is a bug and has just been fixed in the cvs sources. The storage is now freed.


-- Jeff J.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]