summaryrefslogtreecommitdiff
path: root/lib/regex/interp.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-12-01 02:18:55 -0800
committerOri Bernstein <ori@eigenstate.org>2015-12-01 02:18:55 -0800
commit52a5be5adc041a5dc8daa1238a1f307c728e75c8 (patch)
tree03114806b41ee4a9111857b8f26041ae8745554f /lib/regex/interp.myr
parentc61cd86ee5526546e3d36df566e72c1cca0424f7 (diff)
downloadmc-52a5be5adc041a5dc8daa1238a1f307c728e75c8.tar.gz
Fix memory leak.
We weren't freeing the bit set.
Diffstat (limited to 'lib/regex/interp.myr')
-rw-r--r--lib/regex/interp.myr3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/regex/interp.myr b/lib/regex/interp.myr
index 03fd4ab..f8223eb 100644
--- a/lib/regex/interp.myr
+++ b/lib/regex/interp.myr
@@ -24,6 +24,7 @@ const exec = {re, str
thr = run(re)
if thr != Zthr
m = getmatches(re, thr)
+ thrfree(re, thr)
cleanup(re)
-> `std.Some m
else
@@ -99,6 +100,7 @@ const run = {re
if thr.dead
thrfree(re, thr)
elif thr.matched && re.strp == re.str.len
+ std.bsfree(states)
-> thr
elif !thr.matched
std.bsput(states, thr.ip)
@@ -120,6 +122,7 @@ const run = {re
re.expiredtail = Zthr
re.strp++
;;
+ std.bsfree(states)
-> Zthr
}