From 614a03c8868bd4927050828ff1e38af3e0fb1e52 Mon Sep 17 00:00:00 2001 From: thorkill Date: Sun, 5 Jul 2015 00:31:39 +0200 Subject: [PATCH] Do not try to zero memory on unitialized hash --- src/hash.c | 2 ++ 1 file changed, 2 insertions(+) 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); }