From 8771ee452dafdaf695956865631e6de4c9062634 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Sun, 1 Jan 2023 03:59:38 -0700 Subject: locale.c: Don't SAVEFREEPV a void This appears to have been working, but Newx is documented as returning a void, so that SAVEFREEPV() would have been doing nothing. --- locale.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'locale.c') diff --git a/locale.c b/locale.c index 5b9ca50b3b..c94ab112fd 100644 --- a/locale.c +++ b/locale.c @@ -1712,7 +1712,8 @@ S_calculate_LC_ALL(pTHX_ const char ** individ_locales) names_len++; /* Trailing '\0' */ /* Allocate enough space for the aggregated string */ - SAVEFREEPV(Newxz(aggregate_locale, names_len, char)); + Newxz(aggregate_locale, names_len, char); + SAVEFREEPV(aggregate_locale); /* Then fill it in */ for (i = 0; i < NOMINAL_LC_ALL_INDEX; i++) { @@ -6475,10 +6476,8 @@ S_get_displayable_string(pTHX_ * If UTF-8, all are the largest possible code point; otherwise all are a * single byte. '(2 + 1)' is from each byte takes 2 characters to * display, and a blank (or NUL for the final one) after it */ - SAVEFREEPV(Newxz(ret, - (e - s) * (2 + 1) - * ((is_utf8) ? UVSIZE : 1), - char)); + Newxz(ret, (e - s) * (2 + 1) * ((is_utf8) ? UVSIZE : 1), char); + SAVEFREEPV(ret); while (t < e) { UV cp = (is_utf8) -- cgit v1.2.1