perlio.c (PerlIO_tmpfile): fix memory leak
Alexey Tourbin [Sat, 24 Feb 2007 14:47:35 +0000 (17:47 +0300)]
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();