stats plugin: close fd on error
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Sat, 5 Dec 2015 12:42:33 +0000 (13:42 +0100)
committerFlorian Forster <octo@collectd.org>
Sat, 5 Dec 2015 20:33:47 +0000 (21:33 +0100)
CID #37995

Signed-off-by: Florian Forster <octo@collectd.org>
src/statsd.c

index 82dbce7..7336d37 100644 (file)
@@ -557,6 +557,7 @@ static int statsd_network_init (struct pollfd **ret_fds, /* {{{ */
     if (tmp == NULL)
     {
       ERROR ("statsd plugin: realloc failed.");
+      close (fd);
       continue;
     }
     fds = tmp;