From: Dave Mitchell Date: Sun, 25 Jan 2004 02:04:23 +0000 (+0000) Subject: Remove small memory leak in newATTRSUB that manifested as a X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5c41a5fa918d32924e1ac2f02418d5d7f465ef26;p=p5sagit%2Fp5-mst-13.2.git Remove small memory leak in newATTRSUB that manifested as a leaking scalar after the interpeter was cloned p4raw-id: //depot/perl@22209 --- diff --git a/op.c b/op.c index b902fed..5fd21bf 100644 --- a/op.c +++ b/op.c @@ -4165,6 +4165,8 @@ Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block) /* transfer PL_compcv to cv */ cv_undef(cv); CvFLAGS(cv) = CvFLAGS(PL_compcv); + if (!CvWEAKOUTSIDE(cv)) + SvREFCNT_dec(CvOUTSIDE(cv)); CvOUTSIDE(cv) = CvOUTSIDE(PL_compcv); CvOUTSIDE_SEQ(cv) = CvOUTSIDE_SEQ(PL_compcv); CvOUTSIDE(PL_compcv) = 0;