From: Ruben Kerkhof Date: Fri, 1 Apr 2016 16:13:59 +0000 (+0200) Subject: routeros plugin: malloc + memset -> calloc X-Git-Tag: collectd-5.6.0~371^2~18 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=d74128761bfde8e08bad23239c69d1a42b053336;p=collectd.git routeros plugin: malloc + memset -> calloc --- diff --git a/src/routeros.c b/src/routeros.c index 667c2fa5..7ee30248 100644 --- a/src/routeros.c +++ b/src/routeros.c @@ -328,10 +328,9 @@ static int cr_config_router (oconfig_item_t *ci) /* {{{ */ int status; int i; - router_data = malloc (sizeof (*router_data)); + router_data = calloc (1, sizeof (*router_data)); if (router_data == NULL) return (-1); - memset (router_data, 0, sizeof (*router_data)); router_data->connection = NULL; router_data->node = NULL; router_data->service = NULL;