summaryrefslogtreecommitdiff
path: root/locale.c
diff options
context:
space:
mode:
Diffstat (limited to 'locale.c')
-rw-r--r--locale.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/locale.c b/locale.c
index dd3060f2a6..f9b2c9350c 100644
--- a/locale.c
+++ b/locale.c
@@ -323,18 +323,21 @@ Perl_init_i18nl10n(pTHX_ int printwarn)
if (!setlocale_failure) {
#ifdef USE_LOCALE_CTYPE
+ Safefree(curctype);
if (! (curctype = setlocale(LC_CTYPE, "")))
setlocale_failure = TRUE;
else
curctype = savepv(curctype);
#endif /* USE_LOCALE_CTYPE */
#ifdef USE_LOCALE_COLLATE
+ Safefree(curcoll);
if (! (curcoll = setlocale(LC_COLLATE, "")))
setlocale_failure = TRUE;
else
curcoll = savepv(curcoll);
#endif /* USE_LOCALE_COLLATE */
#ifdef USE_LOCALE_NUMERIC
+ Safefree(curnum);
if (! (curnum = setlocale(LC_NUMERIC, "")))
setlocale_failure = TRUE;
else