Commit c2b5c5ee4ca529798154d16cd5da43b88fe44ff9

Luke Dashjr 2012-10-29T07:50:47

Bugfix: Free old stratum_work data before replacing it

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/util.c b/util.c
index 2856915..439c603 100644
--- a/util.c
+++ b/util.c
@@ -1084,6 +1084,13 @@ static bool parse_notify(struct pool *pool, json_t *val)
 	}
 
 	mutex_lock(&pool->pool_lock);
+	free(pool->swork.job_id);
+	free(pool->swork.prev_hash);
+	free(pool->swork.coinbase1);
+	free(pool->swork.coinbase2);
+	free(pool->swork.bbversion);
+	free(pool->swork.nbit);
+	free(pool->swork.ntime);
 	pool->swork.job_id = job_id;
 	pool->swork.prev_hash = prev_hash;
 	pool->swork.coinbase1 = coinbase1;