This is the mail archive of the newlib@sourceware.org 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: [PATH] Avoid double memory free if __sfvwrite_r() fails


On Dec 20 12:33, Aleksandr Platonov wrote:
> Hi.
> fclose() function frees memory area pointed to by fp->_bf._base if __SMBF
> flag is set. But __sfvwrite_r() frees this memory area if _realloc_r()
> fails (see fvwrite.c, line 159) and does not clear __SMBF flag, so this
> memory area will be freed ones again at fclose() call.

Thanks for the patch.  I applied it and added a few words to the
preceeding comment.


Corinna

-- 
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat


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