diff options
author | Benjamin Sugars <bsugars@canoe.ca> | 2001-03-20 05:02:56 -0500 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-03-21 02:23:00 +0000 |
commit | 933fb4e4b6dafdee7ff28c399d8aa8c4737b9819 (patch) | |
tree | 21176a3a495275e8e403999524317114f453f4f3 /perlio.c | |
parent | b5846a0b04f865340214f384842c67c721c12992 (diff) | |
download | perl-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.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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 |