diff options
author | Nicholas Clark <nick@ccl4.org> | 2010-01-15 16:29:56 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2010-01-15 16:29:56 +0000 |
commit | af61dbfdfb97af17b1150478d07da724cd530424 (patch) | |
tree | 8fc653ab4633d5f23f3ab519c2a7ebc917f1a83f /pp_ctl.c | |
parent | b6d1426f94a845fb8fece8b6ad0b7d9f35f2d62e (diff) | |
download | perl-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.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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))); } } |