mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* array.c (flatten): free memo hash table before raising exception.
[ruby-dev:34789] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16518 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1ef64a6624
commit
9d27c792c2
2 changed files with 6 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
Thu May 22 08:28:49 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* array.c (flatten): free memo hash table before raising exception.
|
||||
[ruby-dev:34789]
|
||||
|
||||
Thu May 22 06:30:10 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
|
||||
|
||||
* array.c (flatten): fix memory leak.
|
||||
|
|
1
array.c
1
array.c
|
@ -2848,6 +2848,7 @@ flatten(VALUE ary, int level, int *modified)
|
|||
*modified = 1;
|
||||
id = (st_data_t)tmp;
|
||||
if (st_lookup(memo, id, 0)) {
|
||||
st_free_table(memo);
|
||||
rb_raise(rb_eArgError, "tried to flatten recursive array");
|
||||
}
|
||||
st_insert(memo, id, (st_data_t)Qtrue);
|
||||
|
|
Loading…
Add table
Reference in a new issue