From 01cdeb8da7077b660b70155a1cd244ebbfe2a9a4 Mon Sep 17 00:00:00 2001 From: mame Date: Thu, 16 Oct 2008 14:38:08 +0000 Subject: [PATCH] * compile.c (iseq_set_sequence): fix memory leak. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19803 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ compile.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index e02cb8500f..8c53fc3bfb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Thu Oct 16 23:37:11 2008 Yusuke Endoh + + * compile.c (iseq_set_sequence): fix memory leak. + Thu Oct 16 23:27:27 2008 Tanaka Akira * lib/test/unit.rb (assert_equal): avoid incompatible character diff --git a/compile.c b/compile.c index 6eeb2e4c4d..9ceacd6f00 100644 --- a/compile.c +++ b/compile.c @@ -1309,6 +1309,8 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor) rb_compile_error(RSTRING_PTR(iseq->filename), iobj->line_no, "operand size miss! (%d for %d)", iobj->operand_size, len - 1); + xfree(generated_iseq); + xfree(insn_info_table); return 0; } @@ -1403,6 +1405,8 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor) default: rb_compile_error(RSTRING_PTR(iseq->filename), iobj->line_no, "unknown operand type: %c", type); + xfree(generated_iseq); + xfree(insn_info_table); return 0; } }