Browse Source

Merge branch 'bugfix_reqfail_leak' into bfgminer-2.8.x

Conflicts:
	util.c
Luke Dashjr 13 years ago
parent
commit
a10274b7e0
1 changed files with 1 additions and 2 deletions
  1. 1 2
      util.c

+ 1 - 2
util.c

@@ -456,8 +456,6 @@ json_t *json_rpc_call(CURL *curl, const char *url,
 	    (err_val && !json_is_null(err_val))) {
 		char *s;
 
-		json_decref(val);
-
 		if (err_val)
 			s = json_dumps(err_val, JSON_INDENT(3));
 		else
@@ -466,6 +464,7 @@ json_t *json_rpc_call(CURL *curl, const char *url,
 		applog(LOG_INFO, "JSON-RPC call failed: %s", s);
 
 		free(s);
+		json_decref(val);
 
 		goto err_out;
 	}