From 25d0c332ceb45cddf6a20b47c7d2a86b7f21d63c Mon Sep 17 00:00:00 2001 From: Heng Li Date: Sat, 29 Jan 2011 21:55:39 -0500 Subject: [PATCH] avoid a segfault when connection fails --- knetfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/knetfile.c b/knetfile.c index d7672ea..af09146 100644 --- a/knetfile.c +++ b/knetfile.c @@ -89,7 +89,7 @@ static int socket_connect(const char *host, const char *port) int on = 1, fd; struct linger lng = { 0, 0 }; - struct addrinfo hints, *res; + struct addrinfo hints, *res = 0; memset(&hints, 0, sizeof(struct addrinfo)); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; -- 2.47.3