diff --git a/src/statsd.c b/src/statsd.c
index 610391b1018bdfa04775d6f619bf78daa3a41ca5..54b6e943618d8f65b19c1a538a0cdf6758442814 100644 (file)
--- a/src/statsd.c
+++ b/src/statsd.c
if (tmp == NULL)
{
ERROR ("statsd plugin: realloc failed.");
+ close (fd);
continue;
}
fds = tmp;
void *key;
void *value;
- pthread_mutex_lock (&metrics_lock);
-
if (network_thread_running)
{
network_thread_shutdown = 1;
}
network_thread_running = 0;
+ pthread_mutex_lock (&metrics_lock);
+
while (c_avl_pick (metrics_tree, &key, &value) == 0)
{
sfree (key);