Browse Source

Bugfix: Fix BitFORCE driver memory leak in debug logging

nfactor-troky
Luke Dashjr 13 years ago
parent
commit
829dcf9d2b
  1. 7
      bitforce.c

7
bitforce.c

@ -204,6 +204,7 @@ static uint64_t bitforce_scanhash(struct thr_info *thr, struct work *work, uint6
unsigned char ob[61] = ">>>>>>>>12345678901234567890123456789012123456789012>>>>>>>>"; unsigned char ob[61] = ">>>>>>>>12345678901234567890123456789012123456789012>>>>>>>>";
int i; int i;
char *pnoncebuf; char *pnoncebuf;
char *pblkdata;
uint32_t nonce; uint32_t nonce;
BFwrite(fdDev, "ZDX", 3); BFwrite(fdDev, "ZDX", 3);
@ -220,7 +221,11 @@ static uint64_t bitforce_scanhash(struct thr_info *thr, struct work *work, uint6
memcpy(ob + 8, work->midstate, 32); memcpy(ob + 8, work->midstate, 32);
memcpy(ob + 8 + 32, work->data + 64, 12); memcpy(ob + 8 + 32, work->data + 64, 12);
BFwrite(fdDev, ob, 60); BFwrite(fdDev, ob, 60);
applog(LOG_DEBUG, "BitForce block data: %s", bin2hex(ob + 8, 44)); if (opt_debug) {
pblkdata = bin2hex(ob + 8, 44);
applog(LOG_DEBUG, "BitForce block data: %s", pblkdata);
free(pblkdata);
}
BFgets(pdevbuf, sizeof(pdevbuf), fdDev); BFgets(pdevbuf, sizeof(pdevbuf), fdDev);
if (unlikely(!pdevbuf[0])) { if (unlikely(!pdevbuf[0])) {

Loading…
Cancel
Save