From c394f5ac19c3a42f346955578b7df9c53f1d4057 Mon Sep 17 00:00:00 2001 From: Wang Renxin Date: Mon, 5 Nov 2018 12:09:05 +0800 Subject: [PATCH] *fixed a memory leak with wrong iterator usage. --- HISTORY | 1 + core/my_basic.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/HISTORY b/HISTORY index 703f761..866f98d 100755 --- a/HISTORY +++ b/HISTORY @@ -1,5 +1,6 @@ Nov. 5 2018 Fixed a crash bug when using an iterator in a conditional expression +Fixed a memory leak with wrong iterator usage Jul. 30 2018 Fixed a crash bug with incomplete structures diff --git a/core/my_basic.c b/core/my_basic.c index f85ea54..010e408 100755 --- a/core/my_basic.c +++ b/core/my_basic.c @@ -8001,6 +8001,13 @@ static bool_t _remove_dict(_dict_t* coll, mb_value_t* key) { mb_assert(coll && key); _create_internal_object_from_public_value(key, &okey); + + if(_try_purge_it(coll->ref.s, key, okey)) { + _destroy_object_capsule_only(okey, 0); + + return false; + } + result = _ht_find(coll->dict, okey); if(result && result->data) { _ht_remove(coll->dict, okey, _ls_cmp_extra_object);