This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
locale.c: Use ptr's value before freeing it, not after
authorKarl Williamson <khw@cpan.org>
Fri, 11 Jul 2014 21:56:51 +0000 (15:56 -0600)
committerKarl Williamson <khw@cpan.org>
Sat, 12 Jul 2014 14:41:14 +0000 (08:41 -0600)
This only affected runs with the -DL parameter to perl set.

locale.c

index 1e67e57..f901211 100644 (file)
--- a/locale.c
+++ b/locale.c
@@ -1348,10 +1348,10 @@ Perl__is_cur_LC_category_utf8(pTHX_ int category)
                 name++;
             }
             if (*(name) == '8') {
-                Safefree(save_input_locale);
                 DEBUG_L(PerlIO_printf(Perl_debug_log,
                                       "Locale %s ends with UTF-8 in name\n",
                                       save_input_locale));
+                Safefree(save_input_locale);
                 return TRUE;
             }
         }