merge revision(s) ef59175a68: [Backport #19903]

fix iseq kwargs table and original_iseq leaks

	[bug #19903]

	Co-authored-by: Peter Zhu <peter@peterzhu.ca>
	---
	 iseq.c | 4 ++++
	 1 file changed, 4 insertions(+)
This commit is contained in:
nagachika 2023-09-30 13:48:45 +09:00
parent a191cf5617
commit 128d8728d3
2 changed files with 5 additions and 1 deletions

4
iseq.c
View file

@ -187,7 +187,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);
}