From: Benjamin Sugars Date: Tue, 20 Mar 2001 10:02:56 +0000 (-0500) Subject: Fix for X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=933fb4e4b6dafdee7ff28c399d8aa8c4737b9819;p=p5sagit%2Fp5-mst-13.2.git Fix for Subject: Memory leak in unquoted print Message-ID: p4raw-id: //depot/perl@9273 --- diff --git a/perlio.c b/perlio.c index c8047f8..f0e8074 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