From: Marcus Holland-Moritz Date: Sat, 18 Oct 2008 18:11:57 +0000 (+0000) Subject: Fix memory leak in // caused by single-char character class X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b023a8eeff463528d4a2b46396f79056c0ef9677;p=p5sagit%2Fp5-mst-13.2.git Fix memory leak in // caused by single-char character class optimization. This was most probably introduced with #28262. This change fixes perl #59516. p4raw-id: //depot/perl@34507 --- diff --git a/regcomp.c b/regcomp.c index 54347cc..68cc58c 100644 --- a/regcomp.c +++ b/regcomp.c @@ -8350,6 +8350,9 @@ parseit: *STRING(ret)= (char)value; STR_LEN(ret)= 1; RExC_emit += STR_SZ(1); + if (listsv) { + SvREFCNT_dec(listsv); + } return ret; } /* optimize case-insensitive simple patterns (e.g. /[a-z]/i) */