X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Flibcollectdclient%2Fclient.c;h=0f56bd239891fc3e35b4ddd76461074994356c22;hb=1fc00932fd49fa535551cc4bba09c4e4be059ab4;hp=9ad61f6410a28db3331738147dd534beb72cf8b1;hpb=cf33da9ad00ac94931a2c87563f8d007a996f1ad;p=collectd.git diff --git a/src/libcollectdclient/client.c b/src/libcollectdclient/client.c index 9ad61f64..0f56bd23 100644 --- a/src/libcollectdclient/client.c +++ b/src/libcollectdclient/client.c @@ -500,7 +500,6 @@ static int lcc_open_netsocket (lcc_connection_t *c, /* {{{ */ if (fd < 0) { status = errno; - fd = -1; continue; } @@ -509,7 +508,6 @@ static int lcc_open_netsocket (lcc_connection_t *c, /* {{{ */ { status = errno; close (fd); - fd = -1; continue; } @@ -518,7 +516,6 @@ static int lcc_open_netsocket (lcc_connection_t *c, /* {{{ */ { status = errno; close (fd); - fd = -1; continue; } @@ -529,9 +526,11 @@ static int lcc_open_netsocket (lcc_connection_t *c, /* {{{ */ if (status != 0) { lcc_set_errno (c, status); + freeaddrinfo (ai_res); return (-1); } + freeaddrinfo (ai_res); return (0); } /* }}} int lcc_open_netsocket */