From: Daniel Wagner <[email protected]>
When connect() fails we should close the socket.
Reported by coverity.
---
tools/dnsproxy-test.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/dnsproxy-test.c b/tools/dnsproxy-test.c
index 84602b6..2830577 100644
--- a/tools/dnsproxy-test.c
+++ b/tools/dnsproxy-test.c
@@ -147,6 +147,7 @@ static int connect_tcp_socket(char *server)
if (sk >= 0 && connect(sk, rp->ai_addr, rp->ai_addrlen) < 0) {
err = -errno;
+ close(sk);
fprintf(stderr, "Failed to connect to DNS server at %s "
"errno %d/%s\n",
server, -err, strerror(-err));
--
1.8.4.474.g128a96c
_______________________________________________
connman mailing list
[email protected]
https://lists.connman.net/mailman/listinfo/connman