From 215b7f141b88dfcebccec7fa459cdb03b6bb16bb Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Fri, 1 Apr 2016 18:10:07 +0200 Subject: [PATCH] powerdns plugin: malloc + memset -> calloc --- src/powerdns.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/powerdns.c b/src/powerdns.c index e80ca8a5..1c41ff8d 100644 --- a/src/powerdns.c +++ b/src/powerdns.c @@ -840,13 +840,12 @@ static int powerdns_config_add_server (oconfig_item_t *ci) /* {{{ */ return (-1); } - item = malloc (sizeof (*item)); + item = calloc (1, sizeof (*item)); if (item == NULL) { - ERROR ("powerdns plugin: malloc failed."); + ERROR ("powerdns plugin: calloc failed."); return (-1); } - memset (item, '\0', sizeof (list_item_t)); item->instance = strdup (ci->values[0].value.string); if (item->instance == NULL) -- 2.11.0