diff --git a/ChangeLog b/ChangeLog index e9acff05f7..72f03dc678 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu May 22 08:28:49 2008 Yukihiro Matsumoto + + * array.c (flatten): free memo hash table before raising exception. + [ruby-dev:34789] + Thu May 22 06:30:10 2008 Hidetoshi NAGAI * array.c (flatten): fix memory leak. diff --git a/array.c b/array.c index 0ec6c6e9a8..3936cede42 100644 --- a/array.c +++ b/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);