diff options
author | Father Chrysostomos <sprout@cpan.org> | 2012-11-23 23:32:55 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-11-24 07:35:50 -0800 |
commit | 4ded55f35550b45910091ebeac7889f08d209fe4 (patch) | |
tree | 86646965b44c24d9d96a0d05ece22b129f6748e2 /pp.c | |
parent | 7e18702058e5564da44e84546c67056637b62d83 (diff) | |
download | perl-4ded55f35550b45910091ebeac7889f08d209fe4.tar.gz |
Prevent double frees with lexical constants
my sub foo() { 2 }
This produces a double free, because SAVEPADSVANDMORTALIZE causes the
reference count to go down on scope exit, and nothing was increment-
ing it to compensate.
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -174,7 +174,7 @@ PP(pp_clonecv) /* If this changes to use SAVECLEARSV, we can move the SAVECLEARSV to introcv and remove the SvPADSTALE_off. */ SAVEPADSVANDMORTALIZE(ARGTARG); - PAD_SVl(ARGTARG) = mg->mg_obj; + PAD_SVl(ARGTARG) = SvREFCNT_inc_simple_NN(mg->mg_obj); } else { if (CvROOT(mg->mg_obj)) { |