From: Ruben Kerkhof Date: Fri, 1 Apr 2016 16:10:07 +0000 (+0200) Subject: powerdns plugin: malloc + memset -> calloc X-Git-Tag: collectd-5.6.0~371^2~21 X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=215b7f141b88dfcebccec7fa459cdb03b6bb16bb;p=collectd.git powerdns plugin: malloc + memset -> calloc --- 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)