summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-11-23 23:32:55 -0800
committerFather Chrysostomos <sprout@cpan.org>2012-11-24 07:35:50 -0800
commit4ded55f35550b45910091ebeac7889f08d209fe4 (patch)
tree86646965b44c24d9d96a0d05ece22b129f6748e2 /pp.c
parent7e18702058e5564da44e84546c67056637b62d83 (diff)
downloadperl-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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pp.c b/pp.c
index 8e4c4a6589..e1c9d7580a 100644
--- a/pp.c
+++ b/pp.c
@@ -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)) {