Merge pull request 'Pre-emptively free out the key' (#41) from lda/Cytoplasm:hashmap-del-leak into master

Reviewed-on: Telodendria/Cytoplasm#41
This commit is contained in:
Jordan Bancino 2024-08-09 09:26:49 -04:00
commit 4903c075e8

View file

@ -184,6 +184,8 @@ HashMapDelete(HashMap * map, const char *key)
if (bucket->hash == hash)
{
bucket->hash = 0;
Free(bucket->key);
bucket->key = NULL;
return bucket->value;
}