summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2011-05-18 21:57:25 -0600
committerKarl Williamson <public@khwilliamson.com>2011-05-18 22:53:07 -0600
commitea74ff717a4ba16fc7b858acd65cc2c893970c30 (patch)
tree40397d9f57e02aabcbd7774ebb1a54aea20e918d /regcomp.c
parentcbeadc216ed61f4fa8583ce195c1eddd4eb9384f (diff)
downloadperl-ea74ff717a4ba16fc7b858acd65cc2c893970c30.tar.gz
regcomp.c: Fix regression memory leak
I carelessly added this memory leak which happens in a bracketed character class under /i when there is both a above 255 code point listed plus one of the several below 256 code points that participate in a fold with ones above 256. For 5.16, as the use of the inversion list data structure expands, an automatic method of freeing space will need to be put in place. But this should be sufficient for 5.14.1.
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/regcomp.c b/regcomp.c
index cc0452466e..08cf6a9298 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -10271,7 +10271,9 @@ parseit:
/* Combine the two lists into one. */
if (l1_fold_invlist) {
if (nonbitmap) {
- nonbitmap = invlist_union(nonbitmap, l1_fold_invlist);
+ HV* temp = invlist_union(nonbitmap, l1_fold_invlist);
+ invlist_destroy(nonbitmap);
+ nonbitmap = temp;
}
else {
nonbitmap = l1_fold_invlist;