Fix memory leak in // caused by single-char character class
Marcus Holland-Moritz [Sat, 18 Oct 2008 18:11:57 +0000 (18:11 +0000)]
optimization. This was most probably introduced with #28262.
This change fixes perl #59516.

p4raw-id: //depot/perl@34507

regcomp.c

index 54347cc..68cc58c 100644 (file)
--- 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) */