summaryrefslogtreecommitdiff
path: root/perlio.c
diff options
context:
space:
mode:
authorBenjamin Sugars <bsugars@canoe.ca>2001-03-20 05:02:56 -0500
committerJarkko Hietaniemi <jhi@iki.fi>2001-03-21 02:23:00 +0000
commit933fb4e4b6dafdee7ff28c399d8aa8c4737b9819 (patch)
tree21176a3a495275e8e403999524317114f453f4f3 /perlio.c
parentb5846a0b04f865340214f384842c67c721c12992 (diff)
downloadperl-933fb4e4b6dafdee7ff28c399d8aa8c4737b9819.tar.gz
Fix for
Subject: Memory leak in unquoted print Message-ID: <Pine.LNX.4.21.0103200958180.1538-100000@marmot.rim.canoe.ca> p4raw-id: //depot/perl@9273
Diffstat (limited to 'perlio.c')
-rw-r--r--perlio.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/perlio.c b/perlio.c
index c8047f80d2..f0e8074b50 100644
--- a/perlio.c
+++ b/perlio.c
@@ -3375,6 +3375,7 @@ PerlIO_vprintf(PerlIO *f, const char *fmt, va_list ap)
SV *sv = newSVpvn("",0);
char *s;
STRLEN len;
+ SSize_t wrote;
#ifdef NEED_VA_COPY
va_list apc;
Perl_va_copy(ap, apc);
@@ -3383,7 +3384,9 @@ PerlIO_vprintf(PerlIO *f, const char *fmt, va_list ap)
sv_vcatpvf(sv, fmt, &ap);
#endif
s = SvPV(sv,len);
- return PerlIO_write(f,s,len);
+ wrote = PerlIO_write(f,s,len);
+ SvREFCNT_dec(sv);
+ return wrote;
}
#undef PerlIO_printf