summaryrefslogtreecommitdiff
path: root/id_table.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-12 12:51:56 (GMT)
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-12 12:51:56 (GMT)
commite51491491986df97ecde29c3ef82036fe7c669d1 (patch)
tree7790ef4d37b45e6201ddf5f7904d9c720ed32810 /id_table.c
parent7630957ebaaf982575f93a6e7ebfd08d679e6293 (diff)
* 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
Diffstat (limited to 'id_table.c')
-rw-r--r--id_table.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/id_table.c b/id_table.c
index ad1df05..0277f7b 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;