From: Rafael Garcia-Suarez Date: Thu, 7 Jun 2007 16:09:54 +0000 (+0000) Subject: Plug a memory leak (noticed by Yves) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6499cc01a61ed62809d392d9c843f37a021fbc35;p=p5sagit%2Fp5-mst-13.2.git Plug a memory leak (noticed by Yves) p4raw-id: //depot/perl@31352 --- diff --git a/regcomp.c b/regcomp.c index 6c9fd2a..bfa2c2e 100644 --- a/regcomp.c +++ b/regcomp.c @@ -4883,7 +4883,9 @@ Perl_reg_named_buff_exists(pTHX_ REGEXP * const rx, SV * const key, if (flags & RXf_HASH_ALL) { return hv_exists_ent(rx->paren_names, key, 0); } else { - if (CALLREG_NAMED_BUFF_FETCH(rx, key, flags)) { + SV *sv = CALLREG_NAMED_BUFF_FETCH(rx, key, flags); + if (sv) { + SvREFCNT_dec(sv); return TRUE; } else { return FALSE;