This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
locale.c: Rmv spurious Safefree
authorKarl Williamson <khw@cpan.org>
Sun, 4 Mar 2018 01:54:26 +0000 (18:54 -0700)
committerKarl Williamson <khw@cpan.org>
Sun, 4 Mar 2018 02:55:58 +0000 (19:55 -0700)
I misread the documentation, and Perl_form doesn't need its return value
freed; it's already declared to be temporary, so if this code actually
got executed, there'd be a wrong pool panic

locale.c

index 1634bab..a86a028 100644 (file)
--- a/locale.c
+++ b/locale.c
@@ -964,7 +964,6 @@ S_emulate_setlocale(const int category,
                 if (category == LC_ALL) {
                     char * individ_locale = Perl_form(aTHX_ "%.*s", (int) (p - s), s);
                     emulate_setlocale(categories[i], individ_locale, i, TRUE);
-                    Safefree(individ_locale);
                 }
             }