This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
switch_category_locale_to_template: Fix use-after-free under -DLv
authorDagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Mon, 16 Mar 2020 19:40:00 +0000 (19:40 +0000)
committerDagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Mon, 16 Mar 2020 19:44:58 +0000 (19:44 +0000)
Coverity CID 288709

locale.c

index bffb812..578c54f 100644 (file)
--- a/locale.c
+++ b/locale.c
@@ -4548,7 +4548,7 @@ S_switch_category_locale_to_template(pTHX_ const int switch_category, const int
         Safefree(restore_to_locale);
 
         DEBUG_Lv(PerlIO_printf(Perl_debug_log, "%s locale unchanged as %s\n",
-                            category_name(switch_category), restore_to_locale));
+                            category_name(switch_category), template_locale));
 
         return NULL;
     }