Skip to content

Commit

Permalink
Fix memory leak in the new hashtable unittest
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
enjoy-binbin committed Dec 11, 2024
1 parent 3eb8314 commit 0cc6d8c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/unit/test_hashtable.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 0cc6d8c

Please sign in to comment.