fix: heap-use-after-free and memory leaks on erorr cases
This commit is contained in:
parent
5784f557b8
commit
3fa7b97282
4 changed files with 18 additions and 11 deletions
|
|
@ -117,6 +117,7 @@ void hash_map_free(struct hash_map **hash_map)
|
|||
free((*hash_map)->data);
|
||||
free(*hash_map);
|
||||
}
|
||||
*hash_map = NULL;
|
||||
}
|
||||
|
||||
void hash_map_foreach(struct hash_map *hash_map,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue