Fix memory leak in the new hashtable unittest (#1421)
There is a leak in here, hashtableTwoPhasePopDelete won't call the entry destructor and like hashtablePop we need to call it by myself. Signed-off-by: Binbin <binloveplay1314@qq.com>
This commit is contained in:
parent
3eb8314be6
commit
1acf7f71c0
@ -303,6 +303,7 @@ int test_two_phase_insert_and_pop(int argc, char **argv, int flags) {
|
||||
TEST_ASSERT(hashtableSize(ht) == size_before_find);
|
||||
hashtableTwoPhasePopDelete(ht, &position);
|
||||
TEST_ASSERT(hashtableSize(ht) == size_before_find - 1);
|
||||
free(e);
|
||||
}
|
||||
TEST_ASSERT(hashtableSize(ht) == 0);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user