This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix scalar leak in pp_prtf()
authorDoug MacEachern <dougm@opengroup.org>
Thu, 24 Apr 1997 17:06:21 +0000 (13:06 -0400)
committerChip Salzenberg <chip@atlantic.net>
Thu, 24 Apr 1997 12:00:00 +0000 (00:00 +1200)
private-msgid: 199704241706.NAA19140@postman.osf.org

pp_sys.c

index 9d14089..6247f68 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -1078,7 +1078,7 @@ PP(pp_prtf)
     GV *gv;
     IO *io;
     PerlIO *fp;
-    SV *sv = NEWSV(0,0);
+    SV *sv;
     MAGIC *mg;
 
     if (op->op_flags & OPf_STACKED)
@@ -1106,6 +1106,7 @@ PP(pp_prtf)
        RETURN;
     }
 
+    sv = NEWSV(0,0);
     if (!(io = GvIO(gv))) {
        if (dowarn) {
            gv_fullname3(sv, gv, Nullch);