aboutsummaryrefslogtreecommitdiffstats
path: root/lib/names.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/names.c')
-rw-r--r--lib/names.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/names.c b/lib/names.c
index 3b5b0b1e..fbd6503f 100644
--- a/lib/names.c
+++ b/lib/names.c
@@ -54,15 +54,12 @@ struct db_names *db_names_alloc(void)
{
struct db_names *db;
- db = malloc(sizeof(*db));
+ db = calloc(1, sizeof(*db));
if (!db)
return NULL;
- memset(db, 0, sizeof(*db));
-
db->size = MAX_ENTRIES;
- db->hash = malloc(sizeof(struct db_entry *) * db->size);
- memset(db->hash, 0, sizeof(struct db_entry *) * db->size);
+ db->hash = calloc(db->size, sizeof(struct db_entry *));
return db;
}