summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2010-01-15 16:29:56 +0000
committerNicholas Clark <nick@ccl4.org>2010-01-15 16:29:56 +0000
commitaf61dbfdfb97af17b1150478d07da724cd530424 (patch)
tree8fc653ab4633d5f23f3ab519c2a7ebc917f1a83f /pp_ctl.c
parentb6d1426f94a845fb8fece8b6ad0b7d9f35f2d62e (diff)
downloadperl-af61dbfdfb97af17b1150478d07da724cd530424.tar.gz
Avoid a double SV leak in an error state branch of pp_require.
Avoid using a sprintf format for a constant value (0).
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index 81a942f68e..d5f2f5dfcc 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -3275,21 +3275,21 @@ PP(pp_require)
SVfARG(vnormal(PL_patchlevel)));
}
else { /* probably 'use 5.10' or 'use 5.8' */
- SV * hintsv = newSV(0);
+ SV *hintsv;
I32 second = 0;
if (av_len(lav)>=1)
second = SvIV(*av_fetch(lav,1,0));
second /= second >= 600 ? 100 : 10;
- hintsv = Perl_newSVpvf(aTHX_ "v%d.%d.%d",
- (int)first, (int)second,0);
+ hintsv = Perl_newSVpvf(aTHX_ "v%d.%d.0",
+ (int)first, (int)second);
upg_version(hintsv, TRUE);
DIE(aTHX_ "Perl %"SVf" required (did you mean %"SVf"?)"
"--this is only %"SVf", stopped",
SVfARG(vnormal(req)),
- SVfARG(vnormal(hintsv)),
+ SVfARG(vnormal(sv_2mortal(hintsv))),
SVfARG(vnormal(PL_patchlevel)));
}
}