From b15ebef885dfe8fddb8cc1de9312710238e87ae8 Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Mon, 28 Mar 2016 19:32:51 +0200 Subject: [PATCH] amqp: malloc + memset -> calloc --- src/amqp.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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; -- 2.30.2