summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@ruby-lang.org>2021-03-23 12:02:27 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2021-03-23 13:10:25 -0700
commit417c648f084713e2d6fd8d6d267a7114b711ba70 (patch)
treea3a7732dc3055ff988af7dedd7baf93129ba6d5d /gc.c
parent607aa11711a7975540e1d71c2616ae5533feb35a (diff)
Free iv index table
IV index tables weren't being freed. This program would leak memory: ```ruby loop do k = Class.new do def initialize @a = 1 @b = 1 @c = 1 @d = 1 @e = 1 @f = 1 @g = 1 end end k.new end ``` This commit fixes the leak.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4314
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gc.c b/gc.c
index 1f161b81f4..f7deedcbcd 100644
--- a/gc.c
+++ b/gc.c
@@ -2628,6 +2628,7 @@ static void
iv_index_tbl_free(struct st_table *tbl)
{
st_foreach(tbl, free_iv_index_tbl_free_i, 0);
+ st_free_table(tbl);
}
// alive: if false, target pointers can be freed already.