Browse Source

Merge commit 'f8002e6' into bfgminer-3.5.x

Luke Dashjr 11 years ago
parent
commit
6d85a71bce
1 changed files with 4 additions and 1 deletions
  1. 4 1
      driver-stratum.c

+ 4 - 1
driver-stratum.c

@@ -503,6 +503,8 @@ bool stratumsrv_process_line(struct bufferevent * const bev, const char * const
 	if (!method)
 	if (!method)
 	{
 	{
 		applog(LOG_ERR, "SSM: JSON missing method: %s", ln);
 		applog(LOG_ERR, "SSM: JSON missing method: %s", ln);
+errout:
+		json_decref(json);
 		return false;
 		return false;
 	}
 	}
 	
 	
@@ -510,7 +512,7 @@ bool stratumsrv_process_line(struct bufferevent * const bev, const char * const
 	if (!params)
 	if (!params)
 	{
 	{
 		applog(LOG_ERR, "SSM: JSON missing params: %s", ln);
 		applog(LOG_ERR, "SSM: JSON missing params: %s", ln);
-		return false;
+		goto errout;
 	}
 	}
 	
 	
 	applog(LOG_DEBUG, "SSM: RECV: %s", ln);
 	applog(LOG_DEBUG, "SSM: RECV: %s", ln);
@@ -533,6 +535,7 @@ bool stratumsrv_process_line(struct bufferevent * const bev, const char * const
 		_stratumsrv_failure(bev, idstr, -3, "Method not supported");
 		_stratumsrv_failure(bev, idstr, -3, "Method not supported");
 	
 	
 	free(idstr);
 	free(idstr);
+	json_decref(json);
 	return true;
 	return true;
 }
 }