From: Ruben Kerkhof Date: Fri, 1 Apr 2016 13:49:04 +0000 (+0200) Subject: dbi plugin: malloc + memset -> calloc X-Git-Tag: collectd-5.6.0~371^2~44 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=952a2f399229aa5e327959ba81d32dc47a4745df;p=collectd.git dbi plugin: malloc + memset -> calloc --- 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)