summaryrefslogtreecommitdiffstats
path: root/array.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-22 00:57:47 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-22 00:57:47 +0000
commit0bfca51164c04af58981f554077a257e53ab2eb7 (patch)
tree40a11e96f3ffa8e1272043b664a60e255fd883db /array.c
parent720842ef7847eadcaa43ce9b4eecf7231acf32c6 (diff)
downloadruby-0bfca51164c04af58981f554077a257e53ab2eb7.tar.gz
ruby-0bfca51164c04af58981f554077a257e53ab2eb7.tar.xz
ruby-0bfca51164c04af58981f554077a257e53ab2eb7.zip
* array.c (flatten): free memo hash table before raising exception.
[ruby-dev:34789] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16518 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r--array.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/array.c b/array.c
index 0ec6c6e9a..3936cede4 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);