Unverified Commit ea6aab20 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto Committed by GitHub

Merge pull request #4378 from dearblue/memleak-hashtable

Fix memory leak for hash table index if occur out of memory
parents 6ad89d30 d3288088
......@@ -182,7 +182,7 @@ ht_index(mrb_state *mrb, htable *t)
if (!index || index->capa < size) {
index = (segindex*)mrb_realloc_simple(mrb, index, sizeof(segindex)+sizeof(struct segkv*)*size);
if (index == NULL) {
mrb_free(mrb, index);
mrb_free(mrb, t->index);
t->index = NULL;
return;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment