Commit 4a7ce9dd2a0e9dd100cda850cdc8ae0da08540c5

Con Kolivas 2012-10-01T22:21:43

Avoid duplicating pool->rpc_url and setting pool->stratum_url twice to itself.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/cgminer.c b/cgminer.c
index 894c3cd..b11af03 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -4225,8 +4225,10 @@ retry_stratum:
 	if (unlikely(!pinging && pool->stratum_url)) {
 		applog(LOG_NOTICE, "Switching pool %d %s to %s", pool->pool_no, pool->rpc_url, pool->stratum_url);
 		pool->has_stratum = true;
-		pool->rpc_url = strdup(pool->stratum_url);
-		extract_sockaddr(pool, pool->stratum_url);
+		pool->rpc_url = pool->stratum_url;
+		/* pool->stratum_url will be set again in extract_sockaddr */
+		pool->stratum_url = NULL;
+		extract_sockaddr(pool, pool->rpc_url);
 		initiate_stratum(pool);
 		auth_stratum(pool);
 		curl_easy_cleanup(curl);