projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
collectd.c: dirlen is unsigned
[collectd.git]
/
src
/
statsd.c
diff --git
a/src/statsd.c
b/src/statsd.c
index
ea4123c
..
5b7a6f1
100644
(file)
--- a/
src/statsd.c
+++ b/
src/statsd.c
@@
-127,14
+127,13
@@
static statsd_metric_t *statsd_metric_lookup_unsafe (char const *name, /* {{{ */
return (NULL);
}
return (NULL);
}
- metric =
malloc (
sizeof (*metric));
+ metric =
calloc (1,
sizeof (*metric));
if (metric == NULL)
{
if (metric == NULL)
{
- ERROR ("statsd plugin:
m
alloc failed.");
+ ERROR ("statsd plugin:
c
alloc failed.");
sfree (key_copy);
return (NULL);
}
sfree (key_copy);
return (NULL);
}
- memset (metric, 0, sizeof (*metric));
metric->type = type;
metric->latency = NULL;
metric->type = type;
metric->latency = NULL;
@@
-565,6
+564,7
@@
static int statsd_network_init (struct pollfd **ret_fds, /* {{{ */
if (tmp == NULL)
{
ERROR ("statsd plugin: realloc failed.");
if (tmp == NULL)
{
ERROR ("statsd plugin: realloc failed.");
+ close (fd);
continue;
}
fds = tmp;
continue;
}
fds = tmp;