projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #1611 from stefanth/Collection3/graph-rendering-speedup
[collectd.git]
/
src
/
daemon
/
utils_tail_match.c
diff --git
a/src/daemon/utils_tail_match.c
b/src/daemon/utils_tail_match.c
index
8776ad1
..
1e5da95
100644
(file)
--- a/
src/daemon/utils_tail_match.c
+++ b/
src/daemon/utils_tail_match.c
@@
-126,10
+126,9
@@
cu_tail_match_t *tail_match_create (const char *filename)
{
cu_tail_match_t *obj;
{
cu_tail_match_t *obj;
- obj =
(cu_tail_match_t *) malloc (sizeof (cu_tail_match_t
));
+ obj =
calloc (1, sizeof (*obj
));
if (obj == NULL)
return (NULL);
if (obj == NULL)
return (NULL);
- memset (obj, '\0', sizeof (cu_tail_match_t));
obj->tail = cu_tail_create (filename);
if (obj->tail == NULL)
obj->tail = cu_tail_create (filename);
if (obj->tail == NULL)
@@
-212,13
+211,12
@@
int tail_match_add_match_simple (cu_tail_match_t *obj,
if (match == NULL)
return (-1);
if (match == NULL)
return (-1);
- user_data =
(cu_tail_match_simple_t *) malloc (sizeof (cu_tail_match_simple_t
));
+ user_data =
calloc (1, sizeof (*user_data
));
if (user_data == NULL)
{
match_destroy (match);
return (-1);
}
if (user_data == NULL)
{
match_destroy (match);
return (-1);
}
- memset (user_data, '\0', sizeof (cu_tail_match_simple_t));
sstrncpy (user_data->plugin, plugin, sizeof (user_data->plugin));
if (plugin_instance != NULL)
sstrncpy (user_data->plugin, plugin, sizeof (user_data->plugin));
if (plugin_instance != NULL)