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.5.1~42 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=860aed8d36ccc4a6fee0c23e99e7aba95126e98f;p=collectd.git ceph plugin: close fd on error --- diff --git a/src/ceph.c b/src/ceph.c index f48e056e..3ce9c88f 100644 --- a/src/ceph.c +++ b/src/ceph.c @@ -1085,6 +1085,7 @@ static int cconn_connect(struct cconn *io) { ERROR("ceph plugin: cconn_connect: connect(%d) failed: error %d", fd, err); + close(fd); return err; } @@ -1094,6 +1095,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;