Browse Source

Bugfix: Release job JSON result as soon as we are done using it

It leaked in the retrieve-ok-but-fail-to-decipher case before
Luke Dashjr 13 years ago
parent
commit
56918f4ebc
1 changed files with 1 additions and 1 deletions
  1. 1 1
      miner.c

+ 1 - 1
miner.c

@@ -4495,6 +4495,7 @@ tryagain:
 			goto badwork;
 
 		rc = work_decode(res, work);
+		json_decref(val);
 		if (rc) {
 			applog(LOG_DEBUG, "Successfully retrieved and deciphered work from pool %u %s",
 			       pool->pool_no, pool->rpc_url);
@@ -4516,7 +4517,6 @@ badwork:
 			free_work(work);
 			goto out;
 		}
-		json_decref(val);
 
 		if (pool->lp_url)
 			goto out;