summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorDoug MacEachern <dougm@covalent.net>2001-08-02 13:24:55 -0700
committerJarkko Hietaniemi <jhi@iki.fi>2001-08-03 12:09:50 +0000
commit5f8cb0464db8019389b7bf1816b817fa4d44ca34 (patch)
treedf56724573529c8bbcedb239c398ae4f2abeb257 /op.c
parentbc0a45ed05a5ed25882d9d65d5140ab818bd1fbf (diff)
downloadperl-5f8cb0464db8019389b7bf1816b817fa4d44ca34.tar.gz
[patch] plug PL_regex_padav leaks
Message-ID: <Pine.LNX.4.21.0108022020100.8991-100000@mako.covalent.net> p4raw-id: //depot/perl@11560
Diffstat (limited to 'op.c')
-rw-r--r--op.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/op.c b/op.c
index 7fad9a41a0..daefb1493e 100644
--- a/op.c
+++ b/op.c
@@ -852,8 +852,14 @@ clear_pmop:
#endif
}
cPMOPo->op_pmreplroot = Nullop;
- ReREFCNT_dec(PM_GETRE(cPMOPo));
- PM_SETRE(cPMOPo, (REGEXP*)NULL);
+ /* we use the "SAFE" version of the PM_ macros here
+ * since sv_clean_all might release some PMOPs
+ * after PL_regex_padav has been cleared
+ * and the clearing of PL_regex_padav needs to
+ * happen before sv_clean_all
+ */
+ ReREFCNT_dec(PM_GETRE_SAFE(cPMOPo));
+ PM_SETRE_SAFE(cPMOPo, (REGEXP*)NULL);
break;
}