diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2018-03-17 14:14:25 +0100 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2018-03-17 23:33:58 +0100 |
commit | c82ab92d04acec41f9a3550e2ee7970d3937566e (patch) | |
tree | d7f643aea60e8aab4af31fa8602b09effe8df0b4 /libdm/datastruct | |
parent | 5c40e81a7e6a42e40a49c89758f8e9fd269de8d7 (diff) | |
download | lvm2-c82ab92d04acec41f9a3550e2ee7970d3937566e.tar.gz |
cleanup: use zalloc
Replace malloc() + memset() with zalloc().
Diffstat (limited to 'libdm/datastruct')
-rw-r--r-- | libdm/datastruct/hash.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/libdm/datastruct/hash.c b/libdm/datastruct/hash.c index 6df3efe61..fb153cefa 100644 --- a/libdm/datastruct/hash.c +++ b/libdm/datastruct/hash.c @@ -102,11 +102,9 @@ struct dm_hash_table *dm_hash_create(unsigned size_hint) hc->num_slots = new_size; len = sizeof(*(hc->slots)) * new_size; - if (!(hc->slots = dm_malloc(len))) { - stack; - goto bad; - } - memset(hc->slots, 0, len); + if (!(hc->slots = dm_zalloc(len))) + goto_bad; + return hc; bad: |