4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-01-22 15:07:43 +08:00
Takashi Yano 5ac83ea47a newlib: Fix memory leak regarding gdtoa-based _ldtoa_r().
After the commit a4705d387f78, printf() for floating-point values
causes a memory leak. The legacy _ldtoa_r() assumed the char pointer
returned will be free'ed by Bfree(). However, gdtoa-based _ldtoa_r()
returns the pointer returned by gdtoa() which should be free'ed by
freedtoa(). Due to this issue, the caller of _ldtoa_r() fails to free
the allocated char buffer. This is the cause of the said memory leak.
https://cygwin.com/pipermail/cygwin/2023-July/254054.html

This patch makes rv_alloc()/freedtoa() allocate/free the buffer in
a compatible way with legacy _ldtoa_r().

Fixes: a4705d387f78 ("ldtoa: Import gdtoa from OpenBSD.")
Reported-by: natan_b <natan_b@libero.it>
Reviewed-by: Corinna Vinschen <corinna@vinschen.de>
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2023-08-02 15:00:56 +09:00

20 lines
783 B
Groff

Bug Fixes
---------
- Make <sys/cpuset.h> safe for c89 compilations.
Addresses: https://cygwin.com/pipermail/cygwin-patches/2023q3/012308.html
- Make gcc-specific code in <sys/cpuset.h> compiler-agnostic.
Addresses: https://cygwin.com/pipermail/cygwin/2023-July/253927.html
- Fix AT_EMPTY_PATH handling in fchmodat and fstatat if dirfd referres to
a file other than a directory
Addresses: https://cygwin.com/pipermail/cygwin-patches/2023q2/012306.html
- Rename internal macros _NL_CTYPE_OUTDIGITSx_MB/WC to GLibc compatible
_NL_CTYPE_OUTDIGITx_MB/WC.
Addresses: https://cygwin.com/pipermail/cygwin-developers/2023-July/012637.html
- Fix memory leak in printf() regarding gdtoa-based _ldtoa_r().
Addresses: https://cygwin.com/pipermail/cygwin/2023-July/254054.html