Browse Source

Bugfix: Only free rpc_req after using it, not before

Luke Dashjr 13 years ago
parent
commit
780d7d91a1
2 changed files with 2 additions and 3 deletions
  1. 1 1
      libblkmaker
  2. 1 2
      miner.c

+ 1 - 1
libblkmaker

@@ -1 +1 @@
-Subproject commit fde65d1bc043a13292986c2cab9c3cd01e50735e
+Subproject commit e0b627c6522fdbd7c65f883a2c76e3aa437ce910

+ 1 - 2
miner.c

@@ -5257,8 +5257,6 @@ retry_pool:
 		const char *rpc_req;
 		const char *rpc_req;
 		rpc_req = prepare_rpc_req(work, pool->lp_proto, pool->lp_id);
 		rpc_req = prepare_rpc_req(work, pool->lp_proto, pool->lp_id);
 
 
-		free(rpc_req);
-
 		wait_lpcurrent(cp);
 		wait_lpcurrent(cp);
 
 
 		gettimeofday(&start, NULL);
 		gettimeofday(&start, NULL);
@@ -5270,6 +5268,7 @@ retry_pool:
 		curl_easy_setopt(curl, CURLOPT_FRESH_CONNECT, 1);
 		curl_easy_setopt(curl, CURLOPT_FRESH_CONNECT, 1);
 		val = json_rpc_call(curl, pool->lp_url, pool->rpc_userpass, rpc_req,
 		val = json_rpc_call(curl, pool->lp_url, pool->rpc_userpass, rpc_req,
 				    false, true, &rolltime, pool, false);
 				    false, true, &rolltime, pool, false);
+		free(rpc_req);
 		if (likely(val)) {
 		if (likely(val)) {
 			soval = json_object_get(json_object_get(val, "result"), "submitold");
 			soval = json_object_get(json_object_get(val, "result"), "submitold");
 			if (soval)
 			if (soval)