[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.
This commit is contained in:
parent
c3646294f5
commit
da857a3d53
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue