summaryrefslogtreecommitdiff
path: root/locale.c
diff options
context:
space:
mode:
Diffstat (limited to 'locale.c')
-rw-r--r--locale.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/locale.c b/locale.c
index 0a2669f114..20e5e982f7 100644
--- a/locale.c
+++ b/locale.c
@@ -190,13 +190,17 @@ Perl_new_numeric(pTHX_ const char *newnum)
}
save_newnum = stdize_locale(savepv(newnum));
+
+ PL_numeric_standard = isNAME_C_OR_POSIX(save_newnum);
+ PL_numeric_local = TRUE;
+
if (! PL_numeric_name || strNE(PL_numeric_name, save_newnum)) {
Safefree(PL_numeric_name);
PL_numeric_name = save_newnum;
}
-
- PL_numeric_standard = isNAME_C_OR_POSIX(save_newnum);
- PL_numeric_local = TRUE;
+ else {
+ Safefree(save_newnum);
+ }
/* Keep LC_NUMERIC in the C locale. This is for XS modules, so they don't
* have to worry about the radix being a non-dot. (Core operations that