diff options
author | Karl Williamson <khw@cpan.org> | 2016-03-04 09:34:40 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2016-03-04 12:04:20 -0700 |
commit | 54bc7615b0821ef5fe85ec08e2ba9cc2c5c7c1e5 (patch) | |
tree | 0a509c8d54dea9cd1e2e6a7cd898b82ff8105a51 | |
parent | dc51aebecbd0558a2a7eadb41abd9f445b8c65a5 (diff) | |
download | perl-54bc7615b0821ef5fe85ec08e2ba9cc2c5c7c1e5.tar.gz |
POSIX.xs: Avoid a leak in setlocale()
Tony Cook suggested this fix.
-rw-r--r-- | ext/POSIX/POSIX.xs | 3 | ||||
-rw-r--r-- | ext/POSIX/lib/POSIX.pm | 2 |
2 files changed, 2 insertions, 3 deletions
diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs index f46fedc430..281bea8bae 100644 --- a/ext/POSIX/POSIX.xs +++ b/ext/POSIX/POSIX.xs @@ -2184,6 +2184,7 @@ setlocale(category, locale = 0) /* Save retval since subsequent setlocale() calls may overwrite it. */ retval = savepv(retval); + SAVEFREEPV(retval); /* For locale == 0, we may have switched to NUMERIC_UNDERLYING. Switch * back */ @@ -2259,8 +2260,6 @@ setlocale(category, locale = 0) } OUTPUT: RETVAL - CLEANUP: - Safefree(RETVAL); NV acos(x) diff --git a/ext/POSIX/lib/POSIX.pm b/ext/POSIX/lib/POSIX.pm index 2a5829cd5a..e9c137559b 100644 --- a/ext/POSIX/lib/POSIX.pm +++ b/ext/POSIX/lib/POSIX.pm @@ -4,7 +4,7 @@ use warnings; our ($AUTOLOAD, %SIGRT); -our $VERSION = '1.63'; +our $VERSION = '1.64'; require XSLoader; |