From 77ef775e8a76cb3c0bcc8da460cd3d48bf0d8203 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Sun, 1 Jan 2012 14:19:54 -0800 Subject: =?UTF-8?q?Don=E2=80=99t=20double-free=20GVs=20in=20gv:S=5Fmaybe?= =?UTF-8?q?=5Fadd=5Fcoresub?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit 8756617677 did not take into account that newSVOP steals a ref- erence count. --- gv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gv.c') diff --git a/gv.c b/gv.c index 3005895315..df3735a105 100644 --- a/gv.c +++ b/gv.c @@ -517,7 +517,7 @@ S_maybe_add_coresub(pTHX_ HV * const stash, GV *gv, if (ampable) { CvLVALUE_on(cv); newATTRSUB(oldsavestack_ix, - newSVOP(OP_CONST, 0, (SV *)gv), + newSVOP(OP_CONST, 0, SvREFCNT_inc_simple_NN(gv)), NULL,NULL, coresub_op( opnum -- cgit v1.2.1