X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fpowerdns.c;h=1c41ff8d62ab31a5dca62ee5ac5f0746b8c2ad89;hb=ff9e11ade5cfabf32c63fb19fc76cbbc4186bc5b;hp=ab62dcfdd646ef43077eeb9ce7ac5d17c789fcf7;hpb=a82395b57384541152423862bcf44c0db7789641;p=collectd.git diff --git a/src/powerdns.c b/src/powerdns.c index ab62dcfd..1c41ff8d 100644 --- a/src/powerdns.c +++ b/src/powerdns.c @@ -465,7 +465,7 @@ static int powerdns_get_data_dgram (list_item_t *item, /* {{{ */ return (-1); assert (buffer_size > 0); - buffer = (char *) malloc (buffer_size); + buffer = malloc (buffer_size); if (buffer == NULL) { FUNC_ERROR ("malloc"); @@ -840,13 +840,12 @@ static int powerdns_config_add_server (oconfig_item_t *ci) /* {{{ */ return (-1); } - item = (list_item_t *) malloc (sizeof (list_item_t)); + 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)