From 952a2f399229aa5e327959ba81d32dc47a4745df Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Fri, 1 Apr 2016 15:49:04 +0200 Subject: [PATCH] dbi plugin: malloc + memset -> calloc --- src/dbi.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/dbi.c b/src/dbi.c index dab47d66..7dec51ad 100644 --- a/src/dbi.c +++ b/src/dbi.c @@ -294,13 +294,12 @@ static int cdbi_config_add_database (oconfig_item_t *ci) /* {{{ */ return (-1); } - db = malloc (sizeof (*db)); + db = calloc (1, sizeof (*db)); if (db == NULL) { - ERROR ("dbi plugin: malloc failed."); + ERROR ("dbi plugin: calloc failed."); return (-1); } - memset (db, 0, sizeof (*db)); status = cf_util_get_string (ci, &db->name); if (status != 0) -- 2.11.0