From: Ruben Kerkhof Date: Mon, 28 Mar 2016 17:32:51 +0000 (+0200) Subject: amqp: malloc + memset -> calloc X-Git-Tag: collectd-5.6.0~371^2~51 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b15ebef885dfe8fddb8cc1de9312710238e87ae8;p=collectd.git amqp: malloc + memset -> calloc --- diff --git a/src/amqp.c b/src/amqp.c index 4206bdc1..ec794302 100644 --- a/src/amqp.c +++ b/src/amqp.c @@ -925,15 +925,14 @@ static int camqp_config_connection (oconfig_item_t *ci, /* {{{ */ int status; int i; - conf = malloc (sizeof (*conf)); + conf = calloc (1, sizeof (*conf)); if (conf == NULL) { - ERROR ("amqp plugin: malloc failed."); + ERROR ("amqp plugin: calloc failed."); return (ENOMEM); } /* Initialize "conf" {{{ */ - memset (conf, 0, sizeof (*conf)); conf->publish = publish; conf->name = NULL; conf->format = CAMQP_FORMAT_COMMAND;