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.6.0~526^2 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=21ac5b898e84c3a517fe1cf121bba4e71aff1a85;p=collectd.git libcollectdclient: don't close socket twice CID #38039 --- diff --git a/src/libcollectdclient/network.c b/src/libcollectdclient/network.c index 0539cd0c..7b98497c 100644 --- a/src/libcollectdclient/network.c +++ b/src/libcollectdclient/network.c @@ -89,6 +89,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; @@ -107,12 +108,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);