mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-10 23:08:07 +00:00
Fix nonce1 and sessionid memory leak
This commit is contained in:
parent
a8d683cda9
commit
f8261b1215
3
util.c
3
util.c
@ -1680,6 +1680,7 @@ static bool parse_extranonce(struct pool *pool, json_t *val)
|
|||||||
}
|
}
|
||||||
|
|
||||||
cg_wlock(&pool->data_lock);
|
cg_wlock(&pool->data_lock);
|
||||||
|
free(pool->nonce1);
|
||||||
pool->nonce1 = nonce1;
|
pool->nonce1 = nonce1;
|
||||||
pool->n1_len = strlen(nonce1) / 2;
|
pool->n1_len = strlen(nonce1) / 2;
|
||||||
free(pool->nonce1bin);
|
free(pool->nonce1bin);
|
||||||
@ -2508,6 +2509,8 @@ resend:
|
|||||||
}
|
}
|
||||||
|
|
||||||
cg_wlock(&pool->data_lock);
|
cg_wlock(&pool->data_lock);
|
||||||
|
free(pool->nonce1);
|
||||||
|
free(pool->sessionid);
|
||||||
pool->sessionid = sessionid;
|
pool->sessionid = sessionid;
|
||||||
pool->nonce1 = nonce1;
|
pool->nonce1 = nonce1;
|
||||||
pool->n1_len = strlen(nonce1) / 2;
|
pool->n1_len = strlen(nonce1) / 2;
|
||||||
|
Loading…
Reference in New Issue
Block a user