From d0129370f07f3fcdcb18b9788161abdbbf230325 Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 21 Oct 2001 13:22:54 +0000 Subject: * variable.c (remove_trace): should not access already freed area. * variable.c (rb_f_untrace_var): fix memory leak. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- variable.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'variable.c') diff --git a/variable.c b/variable.c index 71f8585def..70cd46e1ce 100644 --- a/variable.c +++ b/variable.c @@ -598,7 +598,9 @@ remove_trace(entry) trace->next = next->next; free(next); } - trace = next; + else { + trace = next; + } } entry->trace = t.next; } @@ -629,7 +631,6 @@ rb_f_untrace_var(argc, argv) trace->removed = 1; trace = next; } - entry->trace = 0; if (!entry->block_trace) remove_trace(entry); return ary; -- cgit v1.2.3