From: Larry Wall Date: Tue, 14 Mar 1995 23:25:31 +0000 (+1300) Subject: Okay, here's your official unofficial closure leak patch X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b355b4e0798f66a89bbfedc23cbec69c1dff3d33;p=p5sagit%2Fp5-mst-13.2.git Okay, here's your official unofficial closure leak patch --- diff --git a/op.c b/op.c index 3866792..b1f867f 100644 --- a/op.c +++ b/op.c @@ -2676,7 +2676,7 @@ CV* proto; comppadlist = newAV(); AvREAL_off(comppadlist); av_store(comppadlist, 0, SvREFCNT_inc((SV*)protopad_name)); - av_store(comppadlist, 1, SvREFCNT_inc((SV*)comppad)); + av_store(comppadlist, 1, (SV*)comppad); CvPADLIST(cv) = comppadlist; av_extend(comppad, AvFILL(protopad)); curpad = AvARRAY(comppad); diff --git a/pp.c b/pp.c index 51287e1..16e47b6 100644 --- a/pp.c +++ b/pp.c @@ -270,7 +270,7 @@ PP(pp_anoncode) EXTEND(SP,1); if (SvFLAGS(cv) & SVpcv_CLONE) { - cv = cv_clone(cv); + cv = (CV*)sv_2mortal((SV*)cv_clone(cv)); } PUSHs((SV*)cv);