X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Famqp.c;h=2be55e0713efe186268337924357d47a6863a1b9;hb=b5a33aab585aabef83c79bf3261092ca901edf9c;hp=4206bdc1e3ee36b99192452b377943e007fb8af8;hpb=c910d7fdf7ee5ee6730ebd1827dbca2c383c2608;p=collectd.git diff --git a/src/amqp.c b/src/amqp.c index 4206bdc1..2be55e07 100644 --- a/src/amqp.c +++ b/src/amqp.c @@ -736,6 +736,7 @@ static int camqp_subscribe_init (camqp_config_t *conf) /* {{{ */ if (tmp == NULL) { ERROR ("amqp plugin: realloc failed."); + sfree (subscriber_threads); camqp_config_free (conf); return (ENOMEM); } @@ -925,15 +926,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;