Compare commits

..

3 commits

Author SHA1 Message Date
lda
c7204f316c Merge branch 'master' into opt-ssl-for-sha 2024-08-16 12:33:11 -04:00
4903c075e8 Merge pull request 'Pre-emptively free out the key' (#41) from lda/Cytoplasm:hashmap-del-leak into master
Reviewed-on: Telodendria/Cytoplasm#41
2024-08-09 09:26:49 -04:00
LDA
da857a3d53 [FIX] Pre-emptively free out the key
I fail to see a reason why this shouldn't be done, to be fair, and it
fixes a memory leakage with a Cytoplasm-based project I'm making.
2024-07-19 16:08:25 +02:00

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;
}