X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Ftail.c;h=b9e9206890ff965f52521ab77ae722c64e9cfedc;hb=3fae5596643f1e361eb18c3d65448f8bc02fdd80;hp=ffdba8ae3e6ee62eeacf59200a1c4de00b2d1500;hpb=a82395b57384541152423862bcf44c0db7789641;p=collectd.git diff --git a/src/tail.c b/src/tail.c index ffdba8ae..b9e92068 100644 --- a/src/tail.c +++ b/src/tail.c @@ -137,12 +137,10 @@ static int ctail_config_add_match_dstype (ctail_config_match_t *cm, static int ctail_config_add_match (cu_tail_match_t *tm, const char *plugin_instance, oconfig_item_t *ci, cdtime_t interval) { - ctail_config_match_t cm; + ctail_config_match_t cm = { 0 }; int status; int i; - memset (&cm, '\0', sizeof (cm)); - if (ci->values_num != 0) { WARNING ("tail plugin: Ignoring arguments for the `Match' block."); @@ -279,7 +277,7 @@ static int ctail_config_add_file (oconfig_item_t *ci) { cu_tail_match_t **temp; - temp = (cu_tail_match_t **) realloc (tail_match_list, + temp = realloc (tail_match_list, sizeof (cu_tail_match_t *) * (tail_match_list_num + 1)); if (temp == NULL) { @@ -333,7 +331,7 @@ static int ctail_read (user_data_t *ud) static int ctail_init (void) { char str[255]; - user_data_t ud; + user_data_t ud = { 0 }; size_t i; if (tail_match_list_num == 0) @@ -342,8 +340,6 @@ static int ctail_init (void) return (-1); } - memset(&ud, '\0', sizeof(ud)); - for (i = 0; i < tail_match_list_num; i++) { ud.data = (void *)tail_match_list[i];