This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perlio.c (PerlIO_tmpfile): fix memory leak
authorAlexey Tourbin <at@altlinux.ru>
Sat, 24 Feb 2007 14:47:35 +0000 (17:47 +0300)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Sat, 24 Feb 2007 15:42:45 +0000 (15:42 +0000)
Message-ID: <20070224114735.GA3454@localhost.localdomain>

p4raw-id: //depot/perl@30389

perlio.c

index 30f54ec..ad7dec7 100644 (file)
--- a/perlio.c
+++ b/perlio.c
@@ -5086,8 +5086,8 @@ PerlIO_tmpfile(void)
          if (f)
               PerlIOBase(f)->flags |= PERLIO_F_TEMP;
          PerlLIO_unlink(SvPVX_const(sv));
-         SvREFCNT_dec(sv);
      }
+     SvREFCNT_dec(sv);
 #    else      /* !HAS_MKSTEMP, fallback to stdio tmpfile(). */
      FILE * const stdio = PerlSIO_tmpfile();