summaryrefslogtreecommitdiff
path: root/perlio.c
diff options
context:
space:
mode:
authorBrian Fraser <fraserbn@gmail.com>2014-01-21 22:46:10 -0300
committerBrian Fraser <fraserbn@gmail.com>2014-01-21 23:21:07 -0300
commite40f8e806ef39ca48d2e94f25d2b6c5f63b4efda (patch)
tree519d6a3b026fcb1cb4f5228bfe3cfeb5dafb407b /perlio.c
parentb7561fc9bc645b8c7e0e9ebbb29349113cb716c1 (diff)
downloadperl-e40f8e806ef39ca48d2e94f25d2b6c5f63b4efda.tar.gz
PerlIO_tmpfile: Don't leak an SV
This was spotted by Daniel Dragan on the thread for #120591
Diffstat (limited to 'perlio.c')
-rw-r--r--perlio.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/perlio.c b/perlio.c
index ec19bfe453..07de32a1a8 100644
--- a/perlio.c
+++ b/perlio.c
@@ -4967,6 +4967,7 @@ PerlIO_tmpfile(void)
fd = mkstemp(SvPVX(sv));
}
if (fd < 0) {
+ SvREFCNT_dec(sv);
sv = NULL;
/* else we try /tmp */
fd = mkstemp(tempname);