From: Ruben Kerkhof Date: Fri, 4 Dec 2015 18:02:32 +0000 (+0100) Subject: libcollectdclient: don't close socket twice X-Git-Tag: collectd-5.5.1~7^2~6 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=84bf5e22635704f34a0d456ac3d2481ebe0e3672;p=collectd.git libcollectdclient: don't close socket twice CID #38039 --- diff --git a/src/libcollectdclient/network.c b/src/libcollectdclient/network.c index 6733cda4..2f296f64 100644 --- a/src/libcollectdclient/network.c +++ b/src/libcollectdclient/network.c @@ -83,6 +83,7 @@ static int server_close_socket (lcc_server_t *srv) /* {{{ */ return (0); close (srv->fd); + srv->fd = -1; free (srv->sa); srv->sa = NULL; srv->sa_len = 0; @@ -101,12 +102,6 @@ static void int_server_destroy (lcc_server_t *srv) /* {{{ */ next = srv->next; - if (srv->fd >= 0) - { - close (srv->fd); - srv->fd = -1; - } - free (srv->node); free (srv->service); free (srv->username);