diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2014-04-24 20:33:16 -0400 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2014-04-29 09:20:13 +1000 |
commit | d37662c0fabaaa893c0d695034fa83b9235c6872 (patch) | |
tree | 01e44f86d9af609ba646834bfaec6ab016058dba /locale.c | |
parent | 080a70460690846d558714d4dd7c1b2ebb07ee40 (diff) | |
download | perl-d37662c0fabaaa893c0d695034fa83b9235c6872.tar.gz |
Fix for Coverity perl5 CID 45366: Use after free (USE_AFTER_FREE) pass_freed_arg: Passing freed pointer save_input_locale as an argument to PerlIO_printf.
Printfing save-pvs after freeing them.
Diffstat (limited to 'locale.c')
-rw-r--r-- | locale.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1181,20 +1181,20 @@ S_is_cur_LC_category_utf8(pTHX_ int category) && *(save_input_locale + final_pos - 3) == '5' && *(save_input_locale + final_pos - 4) == '6') { - Safefree(save_input_locale); DEBUG_L(PerlIO_printf(Perl_debug_log, "Locale %s ends with 10056 in name, is UTF-8 locale\n", save_input_locale)); + Safefree(save_input_locale); return TRUE; } #endif /* Other common encodings are the ISO 8859 series, which aren't UTF-8 */ if (instr(save_input_locale, "8859")) { - Safefree(save_input_locale); DEBUG_L(PerlIO_printf(Perl_debug_log, "Locale %s has 8859 in name, not UTF-8 locale\n", save_input_locale)); + Safefree(save_input_locale); return FALSE; } |