Browse Source

Merge commit 'f8002e6' into bfgminer

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

+ 4 - 1
driver-stratum.c

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