aboutsummaryrefslogtreecommitdiff
path: root/analyzer/structures/hashmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'analyzer/structures/hashmap.c')
-rw-r--r--analyzer/structures/hashmap.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/analyzer/structures/hashmap.c b/analyzer/structures/hashmap.c
index 7a38852..84cc289 100644
--- a/analyzer/structures/hashmap.c
+++ b/analyzer/structures/hashmap.c
@@ -33,7 +33,7 @@ void hashmap_put(HashMap *map, void *key, void *value) {
if (map->compare(key, node->key)) {
// ensure no hanging memory allocation
if (map->value_cleanup) {
- map->value_cleanup(node);
+ map->value_cleanup(node->value);
}
memcpy(node->value, value, map->value_size);
return;
@@ -72,10 +72,10 @@ void *hashmap_get(HashMap *map, void *key) {
void free_node_without_next(HashMap *map, HashMapNode *node) {
if (map->key_cleanup) {
- map->key_cleanup(node);
+ map->key_cleanup(node->key);
}
if (map->value_cleanup) {
- map->value_cleanup(node);
+ map->value_cleanup(node->value);
}
free(node->key);
free(node->value);