summaryrefslogtreecommitdiffstats
path: root/src/hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/hash.c')
-rw-r--r--src/hash.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/hash.c b/src/hash.c
index 33541e8..700678c 100644
--- a/src/hash.c
+++ b/src/hash.c
@@ -75,8 +75,10 @@ hashtable_create(int hashsize, int limit, int datasize,
void hashtable_destroy(struct hashtable *h)
{
- hashtable_flush(h);
- free(h);
+ if (h) {
+ hashtable_flush(h);
+ free(h);
+ }
}
void *hashtable_add(struct hashtable *table, void *data)