diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2019-04-14 20:36:29 +0900 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-04-14 20:36:29 +0900 |
| commit | ea6aab20e8c81869a3e673bccb985dc1aaa5cfcc (patch) | |
| tree | 1f8d144156c852870044d17107e0fd7e51ad3bc2 /src | |
| parent | 6ad89d30d22021e15e9a0ed8e26f5db53fada4d5 (diff) | |
| parent | d328808892bf866f9ad72ba476fcee00edd06293 (diff) | |
| download | mruby-ea6aab20e8c81869a3e673bccb985dc1aaa5cfcc.tar.gz mruby-ea6aab20e8c81869a3e673bccb985dc1aaa5cfcc.zip | |
Merge pull request #4378 from dearblue/memleak-hashtable
Fix memory leak for hash table index if occur out of memory
Diffstat (limited to 'src')
| -rw-r--r-- | src/hash.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/hash.c b/src/hash.c index c4820513b..a9367a426 100644 --- a/src/hash.c +++ b/src/hash.c @@ -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; } |
