mirror of
https://git.telodendria.io/Telodendria/Cytoplasm.git
synced 2024-10-30 09:10:47 +03:00
Merge pull request 'Pre-emptively free out the key' (#41) from lda/Cytoplasm:hashmap-del-leak into master
Reviewed-on: https://git.telodendria.io/Telodendria/Cytoplasm/pulls/41
This commit is contained in:
commit
4903c075e8
1 changed files with 2 additions and 0 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue