diff options
author | David Robillard <d@drobilla.net> | 2020-08-13 17:25:52 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-08-13 17:25:52 +0200 |
commit | a05b4c9bedfe99815eb887903e7687fe2d1bb3f9 (patch) | |
tree | c1523eec2092148b89625043016940cdefab17e5 /zix | |
parent | adae13963a67d85d39ca990b262688a729a98edc (diff) | |
download | zix-a05b4c9bedfe99815eb887903e7687fe2d1bb3f9.tar.gz zix-a05b4c9bedfe99815eb887903e7687fe2d1bb3f9.tar.bz2 zix-a05b4c9bedfe99815eb887903e7687fe2d1bb3f9.zip |
Make zix_hash_free() tolerate NULL
Diffstat (limited to 'zix')
-rw-r--r-- | zix/hash.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -75,6 +75,10 @@ zix_hash_new(ZixHashFunc hash_func, ZIX_API void zix_hash_free(ZixHash* hash) { + if (!hash) { + return; + } + for (unsigned b = 0; b < *hash->n_buckets; ++b) { ZixHashEntry* bucket = hash->buckets[b]; for (ZixHashEntry* e = bucket; e;) { |