From: Ruben Kerkhof Date: Sat, 28 Nov 2015 19:07:03 +0000 (+0100) Subject: ceph plugin: close fd on error X-Git-Tag: collectd-5.6.0~560^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ac279f801e9a2ffc1f174dafbc41346f4fad0890;p=collectd.git ceph plugin: close fd on error --- diff --git a/src/ceph.c b/src/ceph.c index 419ca6e5..c0df3759 100644 --- a/src/ceph.c +++ b/src/ceph.c @@ -1082,6 +1082,7 @@ static int cconn_connect(struct cconn *io) { ERROR("ceph plugin: cconn_connect: connect(%d) failed: error %d", fd, err); + close(fd); return err; } @@ -1091,6 +1092,7 @@ static int cconn_connect(struct cconn *io) err = -errno; ERROR("ceph plugin: cconn_connect: fcntl(%d, O_NONBLOCK) error %d", fd, err); + close(fd); return err; } io->asok = fd;