summaryrefslogtreecommitdiff
path: root/variable.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-10-21 13:22:54 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-10-21 13:22:54 +0000
commitd0129370f07f3fcdcb18b9788161abdbbf230325 (patch)
treefd89f9ec65c866a2d0e248fcaa8e18870517b5d8 /variable.c
parenteaab0aa79ab884328fc698aaf0b696e656dc5188 (diff)
* 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
Diffstat (limited to 'variable.c')
-rw-r--r--variable.c5
1 files changed, 3 insertions, 2 deletions
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;