diff options
author | Father Chrysostomos <sprout@cpan.org> | 2012-11-02 06:17:36 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-11-02 06:17:36 -0700 |
commit | c7bd8b847014f9a4cd5fa4bcf968ab4a8e11d2fe (patch) | |
tree | eebe0a5ca1061a6055fe878e07c69174c83774ab /pp_sys.c | |
parent | 104c40b089b35a27c011188bbe19b03f1150c54c (diff) | |
download | perl-c7bd8b847014f9a4cd5fa4bcf968ab4a8e11d2fe.tar.gz |
Don’t leak when printf causes wide warnings
Diffstat (limited to 'pp_sys.c')
-rw-r--r-- | pp_sys.c | 5 |
1 files changed, 1 insertions, 4 deletions
@@ -1515,7 +1515,6 @@ PP(pp_prtf) { dVAR; dSP; dMARK; dORIGMARK; PerlIO *fp; - SV *sv = NULL; GV * const gv = (PL_op->op_flags & OPf_STACKED) ? MUTABLE_GV(*++MARK) : PL_defoutgv; @@ -1554,7 +1553,7 @@ PP(pp_prtf) goto just_say_no; } else { - sv = newSV(0); + SV *sv = sv_newmortal(); do_sprintf(sv, SP - MARK, MARK + 1); if (!do_print(sv, fp)) goto just_say_no; @@ -1563,13 +1562,11 @@ PP(pp_prtf) if (PerlIO_flush(fp) == EOF) goto just_say_no; } - SvREFCNT_dec(sv); SP = ORIGMARK; PUSHs(&PL_sv_yes); RETURN; just_say_no: - SvREFCNT_dec(sv); SP = ORIGMARK; PUSHs(&PL_sv_undef); RETURN; |