summaryrefslogtreecommitdiff
path: root/iseq.c
diff options
context:
space:
mode:
authorAdam Hess <HParker@github.com>2023-09-25 23:03:04 +0000
committerPeter Zhu <peter@peterzhu.ca>2023-09-26 11:12:21 -0400
commitef59175a68c448fe334125824b477a9e1d5629bc (patch)
tree27f9cc3064ea5b9409ac34eee73f6890be31fb65 /iseq.c
parent3f511a1d093a85da4f224c0651f8cf922f02f501 (diff)
fix iseq kwargs table and original_iseq leaks
[bug #19903] Co-authored-by: Peter Zhu <peter@peterzhu.ca>
Diffstat (limited to 'iseq.c')
-rw-r--r--iseq.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/iseq.c b/iseq.c
index db7303aac5..6f21e16c83 100644
--- a/iseq.c
+++ b/iseq.c
@@ -188,7 +188,11 @@ rb_iseq_free(const rb_iseq_t *iseq)
ruby_xfree((void *)body->mark_bits.list);
}
+ ruby_xfree(body->variable.original_iseq);
+
if (body->param.keyword != NULL) {
+ if (body->param.keyword->table != &body->local_table[body->param.keyword->bits_start - body->param.keyword->num])
+ ruby_xfree((void *)body->param.keyword->table);
ruby_xfree((void *)body->param.keyword->default_values);
ruby_xfree((void *)body->param.keyword);
}