summaryrefslogtreecommitdiff
path: root/locale.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2015-01-12 22:01:53 -0700
committerKarl Williamson <khw@cpan.org>2015-01-13 12:19:59 -0700
commitc0f3a893f19a236736869b0203e771705a22d986 (patch)
treee980c21dce9e10fc344a0d8edfeb54826d8ddf94 /locale.c
parent3945cc79918c13e0988dc96336c134bc5ce644a0 (diff)
downloadperl-c0f3a893f19a236736869b0203e771705a22d986.tar.gz
locale.c: Fix memory leak.
I spotted this in code review. I didn't add a test for it, because to expose the much more serious bug fixed by the previous commit, I had to temporarily change the C code to force these extremely unlikely-to-be-taken branches to execute.
Diffstat (limited to 'locale.c')
-rw-r--r--locale.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/locale.c b/locale.c
index 8fec798445..e25a789a9a 100644
--- a/locale.c
+++ b/locale.c
@@ -400,6 +400,7 @@ Perl_new_ctype(pTHX_ const char *newctype)
/* The '0' below suppresses a bogus gcc compiler warning */
Perl_warner(aTHX_ packWARN(WARN_LOCALE), SvPVX(PL_warn_locale), 0);
setlocale(LC_CTYPE, badlocale);
+ Safefree(badlocale);
SvREFCNT_dec_NN(PL_warn_locale);
PL_warn_locale = NULL;
}