X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/b1d4925c105b6e865b16a8914b6819899889d639..4eb27fc5a6fd92f91bf314d9f2e4b4da46dc8db1:/locale.c diff --git a/locale.c b/locale.c index 99d42e0..d31db26 100644 --- a/locale.c +++ b/locale.c @@ -3490,14 +3490,12 @@ Perl_my_strerror(pTHX_ const int errnum) /* This function is trivial if we have strerror_l() */ if (within_locale_scope) { - errstr = strerror(errnum); + errstr = savepv(strerror(errnum)); } else { - errstr = strerror_l(errnum, PL_C_locale_obj); + errstr = savepv(strerror_l(errnum, PL_C_locale_obj)); } - errstr = savepv(errstr); - # else /* Doesn't have strerror_l(). */ # ifdef USE_POSIX_2008_LOCALE