summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorJohannes Plunien <plu@pqpq.de>2011-12-13 11:39:52 +0400
committerFather Chrysostomos <sprout@cpan.org>2011-12-13 09:03:01 -0800
commitb28f4af8cf94eb18c0cfde71e9625081912499a8 (patch)
tree44151a10997b62eb4238d0d673ee5f0276f272d5 /regcomp.c
parentd408447cb636e46fcb4f7fe7d0909bb351b7ba22 (diff)
downloadperl-b28f4af8cf94eb18c0cfde71e9625081912499a8.tar.gz
Fix #78266: Memory leak with named regexp captures.
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/regcomp.c b/regcomp.c
index b1b8e6f766..9e9fac4388 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -5418,6 +5418,10 @@ Perl_reg_named_buff_fetch(pTHX_ REGEXP * const r, SV * const namesv,
return newRV_noinc(MUTABLE_SV(retarray));
}
}
+
+ if (ret)
+ SvREFCNT_dec(ret);
+
return NULL;
}