Browse Source

Only check for the stratum clean message if we have had a valid message.

Con Kolivas 12 years ago
parent
commit
3a71ade69a
1 changed files with 2 additions and 2 deletions
  1. 2 2
      cgminer.c

+ 2 - 2
cgminer.c

@@ -5524,8 +5524,7 @@ static void *stratum_rthread(void *userdata)
 
 		if (!parse_method(pool, s) && !parse_stratum_response(pool, s))
 			applog(LOG_INFO, "Unknown stratum msg: %s", s);
-		free(s);
-		if (pool->swork.clean) {
+		else if (pool->swork.clean) {
 			struct work *work = make_work();
 
 			/* Generate a single work item to update the current
@@ -5538,6 +5537,7 @@ static void *stratum_rthread(void *userdata)
 			test_work_current(work);
 			free_work(work);
 		}
+		free(s);
 	}
 
 out: