From 21ac5b898e84c3a517fe1cf121bba4e71aff1a85 Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Fri, 4 Dec 2015 19:02:32 +0100 Subject: [PATCH] libcollectdclient: don't close socket twice CID #38039 --- src/libcollectdclient/network.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) 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); -- 2.30.2