diff --git a/src/tail.c b/src/tail.c
index 9ae4139add86a2bb654895f2a8718f8cfde56770..708cd2a32737e0a10678bc7d650c48c4c6029ba8 100644 (file)
--- a/src/tail.c
+++ b/src/tail.c
cdtime_t interval = 0;
char *plugin_instance = NULL;
int num_matches = 0;
- int status;
int i;
if ((ci->values_num != 1) || (ci->values[0].type != OCONFIG_TYPE_STRING))
if (tm == NULL)
{
ERROR ("tail plugin: tail_match_create (%s) failed.",
- ci->values[0].value.string);
+ ci->values[0].value.string);
return (-1);
}
- status = 0;
for (i = 0; i < ci->children_num; i++)
{
oconfig_item_t *option = ci->children + i;
+ int status = 0;
if (strcasecmp ("Instance", option->key) == 0)
status = cf_util_get_string (option, &plugin_instance);
{
status = ctail_config_add_match (tm, plugin_instance, option, interval);
if (status == 0)
- num_matches++;
+ num_matches++;
/* Be mild with failed matches.. */
status = 0;
}
break;
} /* for (i = 0; i < ci->children_num; i++) */
+ sfree (plugin_instance);
+
if (num_matches == 0)
{
ERROR ("tail plugin: No (valid) matches found for file `%s'.",
- ci->values[0].value.string);
+ ci->values[0].value.string);
tail_match_destroy (tm);
return (-1);
}
cu_tail_match_t **temp;
temp = (cu_tail_match_t **) realloc (tail_match_list,
- sizeof (cu_tail_match_t *) * (tail_match_list_num + 1));
+ sizeof (cu_tail_match_t *) * (tail_match_list_num + 1));
if (temp == NULL)
{
ERROR ("tail plugin: realloc failed.");