diff options
author | Father Chrysostomos <sprout@cpan.org> | 2012-11-02 06:12:27 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-11-02 06:12:27 -0700 |
commit | 104c40b089b35a27c011188bbe19b03f1150c54c (patch) | |
tree | 68c51b091d3b90d41e1b4c5285c3703500de6860 /pp_sys.c | |
parent | 4a608acc6005c3f6abb2284d7bf50732d400aa71 (diff) | |
download | perl-104c40b089b35a27c011188bbe19b03f1150c54c.tar.gz |
Don’t leak when printfing to bad handle under fatal warnings
Diffstat (limited to 'pp_sys.c')
-rw-r--r-- | pp_sys.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1515,7 +1515,7 @@ PP(pp_prtf) { dVAR; dSP; dMARK; dORIGMARK; PerlIO *fp; - SV *sv; + SV *sv = NULL; GV * const gv = (PL_op->op_flags & OPf_STACKED) ? MUTABLE_GV(*++MARK) : PL_defoutgv; @@ -1540,7 +1540,6 @@ PP(pp_prtf) } } - sv = newSV(0); if (!io) { report_evil_fh(gv); SETERRNO(EBADF,RMS_IFI); @@ -1555,6 +1554,7 @@ PP(pp_prtf) goto just_say_no; } else { + sv = newSV(0); do_sprintf(sv, SP - MARK, MARK + 1); if (!do_print(sv, fp)) goto just_say_no; |