Skip to content

Commit

Permalink
Fix memory leak in the new hashtable unittest (valkey-io#1421)
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 <[email protected]>
  • Loading branch information
enjoy-binbin authored Dec 11, 2024
1 parent 3eb8314 commit 1acf7f7
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 1acf7f7

Please sign in to comment.