Do not try to zero memory on unitialized hash

This commit is contained in:
thorkill 2015-07-05 00:31:39 +02:00
parent aea7938f19
commit 614a03c886

View file

@ -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);
}