summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Holland-Moritz <mhx-perl@gmx.net>2008-10-18 18:11:57 +0000
committerMarcus Holland-Moritz <mhx-perl@gmx.net>2008-10-18 18:11:57 +0000
commitb023a8eeff463528d4a2b46396f79056c0ef9677 (patch)
treebeb4cb6bd75456bdb5f3b3b3934710b5480fea1f
parenta954f6ee3112c0edfbc59783d1b424d995122784 (diff)
downloadperl-b023a8eeff463528d4a2b46396f79056c0ef9677.tar.gz
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
-rw-r--r--regcomp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/regcomp.c b/regcomp.c
index 54347cca6e..68cc58cd02 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) */