Use free with ruby_dtoa

In ae0ceafb0c ruby_dtoa was switched to
use malloc instead of xmalloc, which means that consumers should be
using free instead of xfree. Otherwise we will artificially shrink
oldmalloc_increase_bytes.
This commit is contained in:
John Hawthorn 2023-12-06 19:29:06 -08:00
parent 5f81f58b26
commit 0c3593b657
3 changed files with 3 additions and 3 deletions

View file

@ -1078,7 +1078,7 @@ flo_to_s(VALUE flt)
s = sign ? rb_usascii_str_new_cstr("-") : rb_usascii_str_new(0, 0);
if ((digs = (int)(e - p)) >= (int)sizeof(buf)) digs = (int)sizeof(buf) - 1;
memcpy(buf, p, digs);
xfree(p);
free(p);
if (decpt > 0) {
if (decpt < digs) {
memmove(buf + decpt + 1, buf + decpt, digs - decpt);