diff options
author | Karl Williamson <khw@cpan.org> | 2015-01-12 22:01:53 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2015-01-13 12:19:59 -0700 |
commit | c0f3a893f19a236736869b0203e771705a22d986 (patch) | |
tree | e980c21dce9e10fc344a0d8edfeb54826d8ddf94 /locale.c | |
parent | 3945cc79918c13e0988dc96336c134bc5ce644a0 (diff) | |
download | perl-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.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -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; } |