summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorDave Mitchell <davem@fdisolutions.com>2004-01-25 02:04:23 +0000
committerDave Mitchell <davem@fdisolutions.com>2004-01-25 02:04:23 +0000
commit5c41a5fa918d32924e1ac2f02418d5d7f465ef26 (patch)
treee0f36879109e084ef0f72656ca3203618f6be129 /op.c
parent8731c5d9eb453a5b2d087dabd7a5f51b576b8048 (diff)
downloadperl-5c41a5fa918d32924e1ac2f02418d5d7f465ef26.tar.gz
Remove small memory leak in newATTRSUB that manifested as a
leaking scalar after the interpeter was cloned p4raw-id: //depot/perl@22209
Diffstat (limited to 'op.c')
-rw-r--r--op.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/op.c b/op.c
index b902fed248..5fd21bf975 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;