diff --git a/src/hash.c b/src/hash.c index 91fc3d67..2a9c175c 100644 --- a/src/hash.c +++ b/src/hash.c @@ -101,6 +101,8 @@ void hash_delete(hash_t *hash, const void *key) { /* Utility functions */ void hash_clear(hash_t *hash) { + if (!hash) + return; memset(hash->values, 0, hash->n * sizeof *hash->values); }