Skip to content

Commit

Permalink
make sure to free context in all paths
Browse files Browse the repository at this point in the history
  • Loading branch information
erkmos committed May 22, 2014
1 parent f507c1f commit 79a4772
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cryptonight.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ int scanhash_cryptonight(int thr_id, uint32_t *pdata, const uint32_t *ptarget,
cryptonight_hash_ctx_aes_ni(hash, pdata, 76, ctx);
if (unlikely(hash[7] < ptarget[7])) {
*hashes_done = n - first_nonce + 1;
free(ctx);
return true;
}
} while (likely((n <= max_nonce && !work_restart[thr_id].restart)));
Expand All @@ -288,6 +289,7 @@ int scanhash_cryptonight(int thr_id, uint32_t *pdata, const uint32_t *ptarget,
cryptonight_hash_ctx(hash, pdata, 76, ctx);
if (unlikely(hash[7] < ptarget[7])) {
*hashes_done = n - first_nonce + 1;
free(ctx);
return true;
}
} while (likely((n <= max_nonce && !work_restart[thr_id].restart)));
Expand Down

0 comments on commit 79a4772

Please sign in to comment.