summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/hashmap.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/shared/hashmap.c b/src/shared/hashmap.c
index ab00957306..e2395d4d42 100644
--- a/src/shared/hashmap.c
+++ b/src/shared/hashmap.c
@@ -277,6 +277,9 @@ void hashmap_free(Hashmap*h) {
}
void hashmap_free_free(Hashmap *h) {
+ if (!h)
+ return;
+
hashmap_clear_free(h);
hashmap_free(h);
}
@@ -292,7 +295,8 @@ void hashmap_clear(Hashmap *h) {
void hashmap_clear_free(Hashmap *h) {
void *p;
- assert(h);
+ if (!h)
+ return;
while ((p = hashmap_steal_first(h)))
free(p);