From e51491491986df97ecde29c3ef82036fe7c669d1 Mon Sep 17 00:00:00 2001 From: ko1 Date: Wed, 12 Aug 2015 12:51:56 +0000 Subject: [PATCH] * id_table.c (mix_id_table_insert): fix memory leak. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ id_table.c | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index c9224353be..1171067104 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Wed Aug 12 21:51:11 2015 Koichi Sasada + + * id_table.c (mix_id_table_insert): fix memory leak. + Wed Aug 12 21:17:38 2015 Eric Wong * iseq.c (iseq_memsize): reimplement for wrapper diff --git a/id_table.c b/id_table.c index ad1df059bc..0277f7b1fc 100644 --- a/id_table.c +++ b/id_table.c @@ -1458,6 +1458,11 @@ mix_id_table_insert(struct mix_id_table *tbl, ID id, VALUE val) hash_id_table_insert_key(hash, keys[i], values[i]); } + /* free list keys/values */ + xfree(keys); +#if ID_TABLE_USE_CALC_VALUES == 0 + xfree(values); +#endif assert(LIST_P(tbl) == 0); } return r;