fix: heap-use-after-free and memory leaks on erorr cases

This commit is contained in:
matteo 2026-01-30 12:21:29 +01:00
parent 5784f557b8
commit 3fa7b97282
4 changed files with 18 additions and 11 deletions

View file

@ -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,