projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
src/Makefile: Don't unnecessarily set plugin specific CXXFLAGS.
[collectd.git]
/
src
/
statsd.c
diff --git
a/src/statsd.c
b/src/statsd.c
index
d0a677e
..
3c08861
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;
@@
-956,8
+955,6
@@
static int statsd_shutdown (void) /* {{{ */
void *key;
void *value;
void *key;
void *value;
- pthread_mutex_lock (&metrics_lock);
-
if (network_thread_running)
{
network_thread_shutdown = 1;
if (network_thread_running)
{
network_thread_shutdown = 1;
@@
-966,6
+963,8
@@
static int statsd_shutdown (void) /* {{{ */
}
network_thread_running = 0;
}
network_thread_running = 0;
+ pthread_mutex_lock (&metrics_lock);
+
while (c_avl_pick (metrics_tree, &key, &value) == 0)
{
sfree (key);
while (c_avl_pick (metrics_tree, &key, &value) == 0)
{
sfree (key);