Skip to content

Commit 5c41a5f

Browse files
author
Dave Mitchell
committed
Remove small memory leak in newATTRSUB that manifested as a
leaking scalar after the interpeter was cloned p4raw-id: //depot/perl@22209
1 parent 8731c5d commit 5c41a5f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

op.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4165,6 +4165,8 @@ Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block)
41654165
/* transfer PL_compcv to cv */
41664166
cv_undef(cv);
41674167
CvFLAGS(cv) = CvFLAGS(PL_compcv);
4168+
if (!CvWEAKOUTSIDE(cv))
4169+
SvREFCNT_dec(CvOUTSIDE(cv));
41684170
CvOUTSIDE(cv) = CvOUTSIDE(PL_compcv);
41694171
CvOUTSIDE_SEQ(cv) = CvOUTSIDE_SEQ(PL_compcv);
41704172
CvOUTSIDE(PL_compcv) = 0;

0 commit comments

Comments
 (0)