Browse Source

Bugfix: In benchmark mode, only remove the new pools after putting them in the array, since the removal will try to remove it from the array

Luke Dashjr 11 years ago
parent
commit
3c75d47471
1 changed files with 4 additions and 4 deletions
  1. 4 4
      miner.c

+ 4 - 4
miner.c

@@ -1059,16 +1059,16 @@ struct pool *add_pool(void)
 	pool->sock = INVSOCK;
 	pool->lp_socket = CURL_SOCKET_BAD;
 
+	pools = realloc(pools, sizeof(struct pool *) * (total_pools + 2));
+	pools[total_pools++] = pool;
+	
 	if (opt_benchmark)
 	{
-		// Don't add to pools array, but immediately remove it
+		// Immediately remove it
 		remove_pool(pool);
 		return pool;
 	}
 	
-	pools = realloc(pools, sizeof(struct pool *) * (total_pools + 2));
-	pools[total_pools++] = pool;
-
 	return pool;
 }