mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-09 06:18:06 +00:00
Free avalon->works in the event we call avalon_prepare on failure to initialise.
This commit is contained in:
parent
be5a20c8d6
commit
b2106b3aed
@ -645,10 +645,14 @@ static bool avalon_prepare(struct thr_info *thr)
|
||||
struct avalon_info *info = avalon_infos[avalon->device_id];
|
||||
struct timeval now;
|
||||
|
||||
free(avalon->works);
|
||||
avalon->works = calloc(info->miner_count * sizeof(struct work *), 4);
|
||||
if (!avalon->works)
|
||||
quit(1, "Failed to calloc avalon works in avalon_prepare");
|
||||
__avalon_init(avalon);
|
||||
if (avalon->device_fd == -1)
|
||||
avalon_init(avalon);
|
||||
else
|
||||
__avalon_init(avalon);
|
||||
|
||||
gettimeofday(&now, NULL);
|
||||
get_datestamp(avalon->init, &now);
|
||||
|
Loading…
Reference in New Issue
Block a user