Commit 1a43cb0b17d05a5fa9c728eaaa5e547896fc2f21

Con Kolivas 2013-05-08T22:11:01

Free servinfo after p is checked in setup stratum socket.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
diff --git a/util.c b/util.c
index 944cc8e..5810f94 100644
--- a/util.c
+++ b/util.c
@@ -1525,12 +1525,13 @@ static bool setup_stratum_socket(struct pool *pool)
 
 		break;
 	}
-	freeaddrinfo(servinfo);
 	if (p == NULL) {
 		applog(LOG_WARNING, "Failed to find servinfo on %s:%s",
 		       pool->sockaddr_url, pool->stratum_port);
+		freeaddrinfo(servinfo);
 		return false;
 	}
+	freeaddrinfo(servinfo);
 
 	if (!pool->sockbuf) {
 		pool->sockbuf = calloc(RBUFSIZE, 1);