Skip to content

Conversation

@tshmieldev
Copy link

@tshmieldev tshmieldev commented Oct 22, 2025

Before, in ht_del_hash_table, free() would be called on pointers to HT_DELETED_ITEM, resulting in an error.

Also before, calling ht_delete with key that's not in the hash table would result in ht_count being decremented anyway.
Added an early return for when the item is marked as no further checks need to be made.

Before, calling ht_delete with key that's not in the hash table would result in ht_count being decremented anyway.

Also added an early return for when the item is marked as no further checks need to be made.
Before, free() would be called on pointers to HT_DELETED_ITEM, resulting in an error
@tshmieldev tshmieldev changed the title Fixed decrement bug for ht_delete [MAJOR BUG FIX] - Fixed bad free() calls, fixed decrement bug for ht_delete Oct 22, 2025
@tshmieldev
Copy link
Author

@jamesroutley I believe those fixes are important, people are learning from this repo. Please review my PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant