Pre-emptively free out the key #41

Merged
jordan merged 1 commit from lda/Cytoplasm:hashmap-del-leak into master 2024-08-09 13:26:50 +00:00
Showing only changes of commit da857a3d53 - Show all commits

View file

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