Takashi Yano
841b7307d6
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 21:59:42 +09:00
..
2022-08-29 17:53:48 +01:00
2023-06-02 10:28:12 +09:00
2023-07-10 10:29:41 +02:00
2022-08-04 20:54:09 +02:00
2022-10-24 14:09:07 +02:00
2023-05-01 18:24:36 +01:00
2023-04-18 13:43:31 +02:00
2023-04-18 10:12:43 +02:00
2023-08-02 21:59:42 +09:00
2022-11-24 12:20:50 +01:00
2023-02-09 21:59:47 +01:00
2021-11-10 20:16:15 -05:00
2022-12-16 10:22:37 +00:00
2022-08-04 22:13:59 +02:00
2022-08-04 22:13:59 +02:00
2022-08-04 20:54:09 +02:00
2022-08-04 22:13:59 +02:00
2022-10-28 16:26:53 +02:00
2022-05-16 18:17:06 +02:00
2022-08-03 15:59:37 +02:00
2022-08-04 22:13:59 +02:00
2022-08-23 12:09:44 +02:00
2023-01-09 13:43:26 +01:00
2022-10-28 16:26:53 +02:00
2023-01-10 21:34:46 +09:00
2022-08-22 14:38:49 +02:00
2023-01-22 09:59:50 +01:00
2023-01-22 09:59:50 +01:00
2021-11-15 19:32:23 -05:00
2022-05-29 17:54:32 -04:00
2022-06-06 12:00:45 -04:00
2023-03-07 10:19:53 +09:00
2022-08-03 15:35:34 +02:00
2022-08-04 15:16:48 +02:00
2022-11-04 13:25:54 +00:00
2022-07-28 22:00:40 +02:00
2022-12-02 16:35:31 +01:00
2022-05-29 17:45:52 -04:00
2022-08-04 22:13:59 +02:00
2022-08-29 12:25:24 +02:00
2022-05-04 15:08:44 +02:00
2022-05-29 17:45:52 -04:00
2022-10-28 12:44:27 +02:00
2022-05-29 17:45:52 -04:00
2022-07-28 16:38:01 +02:00
2022-08-04 22:13:59 +02:00
2022-05-29 17:45:52 -04:00
2022-08-04 22:13:59 +02:00
2022-08-04 22:13:59 +02:00
2022-05-29 17:54:32 -04:00
2022-12-13 15:25:06 +01:00
2022-08-10 18:06:28 +02:00
2022-05-29 17:45:52 -04:00
2023-01-23 14:03:25 +01:00
2022-08-04 11:45:58 +02:00
2022-08-23 12:09:44 +02:00
2022-06-06 12:00:45 -04:00
2022-05-29 17:45:52 -04:00
2023-05-24 22:06:22 +01:00
2023-01-17 19:47:33 +01:00
2022-06-27 10:54:24 +09:00
2022-08-10 18:11:57 +02:00
2022-08-22 14:53:30 +02:00
2022-08-04 22:13:59 +02:00
2022-08-03 16:01:29 +02:00
2022-06-06 12:00:45 -04:00
2022-10-19 08:17:50 -04:00
2022-08-22 14:28:11 +02:00
2022-05-29 17:45:52 -04:00
2023-01-10 11:49:08 +01:00
2022-08-22 17:58:53 +02:00
2022-11-20 10:37:37 +09:00
2022-06-06 12:00:45 -04:00
2022-08-04 22:13:59 +02:00
2023-03-15 22:09:28 +01:00
2023-07-26 15:19:59 +02:00
2022-05-29 17:54:32 -04:00
2022-08-03 15:35:29 +02:00
2023-06-23 00:29:30 +09:00
2022-08-04 22:13:59 +02:00
2022-06-06 12:00:45 -04:00
2022-08-23 12:09:44 +02:00
2022-06-06 12:00:45 -04:00
2022-12-02 16:49:47 +01:00
2022-12-11 11:25:04 +01:00
2022-10-28 16:26:53 +02:00
2022-08-04 22:13:59 +02:00