Do not try to zero memory on unitialized hash
This commit is contained in:
parent
aea7938f19
commit
614a03c886
1 changed files with 2 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue