Bugfix: Free old stratum_work data before replacing it
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;