Browse Source

Bugfix: Stratum initiate: Clear json var after freeing it, to avoid a potential double-free if retry fails before new JSON is parsed

Luke Dashjr 12 years ago
parent
commit
aee7b3fa6d
1 changed files with 3 additions and 0 deletions
  1. 3 0
      util.c

+ 3 - 0
util.c

@@ -1648,7 +1648,10 @@ bool initiate_stratum(struct pool *pool)
 	ret = true;
 	ret = true;
 out:
 out:
 	if (val)
 	if (val)
+	{
 		json_decref(val);
 		json_decref(val);
+		val = NULL;
+	}
 
 
 	if (ret) {
 	if (ret) {
 		if (!pool->stratum_url)
 		if (!pool->stratum_url)