1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-31 00:44:19 +00:00

Merge pull request #316 from Elbandi/v5_0-leakfix

Fix nonce1 and sessionid memory leak
This commit is contained in:
troky 2014-07-03 17:45:13 +02:00
commit 8567370f8c

3
util.c
View File

@ -1700,6 +1700,7 @@ static bool parse_extranonce(struct pool *pool, json_t *val)
}
cg_wlock(&pool->data_lock);
free(pool->nonce1);
pool->nonce1 = nonce1;
pool->n1_len = strlen(nonce1) / 2;
free(pool->nonce1bin);
@ -2527,6 +2528,8 @@ resend:
}
cg_wlock(&pool->data_lock);
free(pool->nonce1);
free(pool->sessionid);
pool->sessionid = sessionid;
pool->nonce1 = nonce1;
pool->n1_len = strlen(nonce1) / 2;