mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* eval.c (blk_free): fixed serious memory leak. [ruby-dev:24013]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6733 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
82c39d5579
commit
c267d34070
2 changed files with 18 additions and 1 deletions
|
@ -1,3 +1,7 @@
|
|||
Mon Aug 2 17:40:44 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* eval.c (blk_free): fixed serious memory leak. [ruby-dev:24013]
|
||||
|
||||
Mon Aug 2 11:53:06 2004 Dave Thomas <dave@pragprog.com>
|
||||
|
||||
* lib/rdoc/code_objects.rb (RDoc::Context::find_symbol): Fix infinite recursion
|
||||
|
|
15
eval.c
15
eval.c
|
@ -668,7 +668,6 @@ static unsigned long frame_unique = 0;
|
|||
_frame.node = ruby_current_node; \
|
||||
_frame.iter = ruby_iter->iter; \
|
||||
_frame.argc = 0; \
|
||||
_frame.flags = FRAME_ALLOCA; \
|
||||
_frame.uniq = frame_unique++; \
|
||||
ruby_frame = &_frame
|
||||
|
||||
|
@ -7750,6 +7749,20 @@ static void
|
|||
blk_free(data)
|
||||
struct BLOCK *data;
|
||||
{
|
||||
struct FRAME *frame;
|
||||
void *tmp;
|
||||
|
||||
frame = data->frame.prev;
|
||||
while (frame) {
|
||||
tmp = frame;
|
||||
frame = frame->prev;
|
||||
free(tmp);
|
||||
}
|
||||
while (data) {
|
||||
tmp = data;
|
||||
data = data->prev;
|
||||
free(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in a new issue