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:
Binbin 2024-12-11 13:40:18 +08:00 committed by GitHub
parent 3eb8314be6
commit 1acf7f71c0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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);