Commit bec40c5b685bc53869e3a394555383166b943ba5

Con Kolivas 2013-08-31T13:32:40

Provide base structures for getaddrinfo.

diff --git a/util.c b/util.c
index f0e920f..94c4abf 100644
--- a/util.c
+++ b/util.c
@@ -1728,7 +1728,7 @@ out:
 
 static bool setup_stratum_socket(struct pool *pool)
 {
-	struct addrinfo *servinfo, *hints, *p;
+	struct addrinfo servinfobase, *servinfo, *hints, pbase, *p;
 	int sockd;
 
 	mutex_lock(&pool->stratum_lock);
@@ -1742,6 +1742,8 @@ static bool setup_stratum_socket(struct pool *pool)
 	memset(hints, 0, sizeof(struct addrinfo));
 	hints->ai_family = AF_UNSPEC;
 	hints->ai_socktype = SOCK_STREAM;
+	servinfo = &servinfobase;
+	p = &pbase;
 	if (getaddrinfo(pool->sockaddr_url, pool->stratum_port, hints, &servinfo) != 0) {
 		if (!pool->probed) {
 			applog(LOG_WARNING, "Failed to resolve (?wrong URL) %s:%s",