diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-07 22:26:45 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-07 22:26:45 +0000 |
commit | 26b037feb8cf0061da416d36e3732a3185cddedb (patch) | |
tree | 0f9deae577814fe28404267c78a52e2c11122435 /array.c | |
parent | 70c59ba555d80e0d7f795c20cfa4974d822f29f6 (diff) |
merge revision(s) 61561: [Backport #14272]
fix memory leak (FOUND BY A COMPILER WARNING)
Confusion of argument order ignores this st_free_table.
Results in garbaged table not GCed.
Easily noticable when you read the compiper warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@61661 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r-- | array.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -4953,7 +4953,7 @@ rb_ary_sample(int argc, VALUE *argv, VALUE ary) long max_idx = 0; #undef RUBY_UNTYPED_DATA_WARNING #define RUBY_UNTYPED_DATA_WARNING 0 - VALUE vmemo = Data_Wrap_Struct(0, 0, 0, st_free_table); + VALUE vmemo = Data_Wrap_Struct(0, 0, st_free_table, 0); st_table *memo = st_init_numtable_with_size(n); DATA_PTR(vmemo) = memo; result = rb_ary_new_capa(n); |