X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frouteros.c;h=400ee42b64fcd294106f8681dfee3d3d9e77a0d1;hb=d74128761bfde8e08bad23239c69d1a42b053336;hp=4ca9d5b2e77e6b3d059aee2e1d656b0d62cbf292;hpb=5c78be034ebf8edbf2ae98e9163a38b2d61fbb68;p=collectd.git diff --git a/src/routeros.c b/src/routeros.c index 4ca9d5b2..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; @@ -414,7 +413,7 @@ static int cr_config_router (oconfig_item_t *ci) /* {{{ */ user_data.free_func = (void *) cr_free_data; if (status == 0) status = plugin_register_complex_read (/* group = */ NULL, read_name, - cr_read, /* interval = */ NULL, &user_data); + cr_read, /* interval = */ 0, &user_data); if (status != 0) cr_free_data (router_data);