aboutsummaryrefslogtreecommitdiffstats
path: root/vsnprintf.c
diff options
context:
space:
mode:
authorJohn Hawthorn <john@hawthorn.email>2023-12-06 19:29:06 -0800
committerJohn Hawthorn <john@hawthorn.email>2023-12-07 09:23:02 -0800
commit0c3593b6573b4186c980fb4ea7635bf95261c749 (patch)
treedad6fbb807b95da2afeb82470642e84fcd739e12 /vsnprintf.c
parent5f81f58b2696db3c1c3fc44a2c83dbff85747100 (diff)
downloadruby-0c3593b6573b4186c980fb4ea7635bf95261c749.tar.gz
Use free with ruby_dtoa
In ae0ceafb0c0d05cc80623b525070255e3abb34ef 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.
Diffstat (limited to 'vsnprintf.c')
-rw-r--r--vsnprintf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/vsnprintf.c b/vsnprintf.c
index 212bb06c5e..ecd5573dd5 100644
--- a/vsnprintf.c
+++ b/vsnprintf.c
@@ -1255,8 +1255,8 @@ cvt(double value, int ndigits, int flags, char *sign, int *decpt, int ch, int *l
}
buf[0] = 0; /* rve - digits may be 0 */
memcpy(buf, digits, rve - digits);
- xfree(digits);
rve = buf + (rve - digits);
+ free(digits);
digits = buf;
if (flags & ALT) { /* Print trailing zeros */
bp = digits + ndigits;