summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/regcomp.c b/regcomp.c
index 3581a5da3c..0f48976db8 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -2574,12 +2574,13 @@ pregfree(struct regexp *r)
Safefree(r->precomp);
if (r->subbase)
Safefree(r->subbase);
- if (r->substrs)
+ if (r->substrs) {
+ if (r->anchored_substr)
+ SvREFCNT_dec(r->anchored_substr);
+ if (r->float_substr)
+ SvREFCNT_dec(r->float_substr);
Safefree(r->substrs);
- if (r->anchored_substr)
- SvREFCNT_dec(r->anchored_substr);
- if (r->float_substr)
- SvREFCNT_dec(r->float_substr);
+ }
if (r->data) {
int n = r->data->count;
while (--n >= 0) {