mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-01-25 01:22:23 +08:00
Merge pull request #573 from h4waii/patch-3
fix: #520 - free mutex after work is done
This commit is contained in:
commit
fc84a285ff
1 changed files with 2 additions and 4 deletions
|
@ -1845,14 +1845,15 @@ static bool TestIfKeyExists(uint64_t key) {
|
|||
num_keys_tested += count;
|
||||
hardnested_print_progress(num_acquired_nonces, "(Test: Key found)", 0.0, 0);
|
||||
crypto1_destroy(pcs);
|
||||
pthread_mutex_destroy(&statelist_cache_mutex);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
num_keys_tested += count;
|
||||
hardnested_print_progress(num_acquired_nonces, "(Test: Key NOT found)", 0.0, 0);
|
||||
|
||||
crypto1_destroy(pcs);
|
||||
pthread_mutex_destroy(&statelist_cache_mutex);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -2042,9 +2043,6 @@ static void generate_candidates(uint8_t sum_a0_idx, uint8_t sum_a8_idx) {
|
|||
pthread_join(thread_id[i], NULL);
|
||||
}
|
||||
|
||||
// clean up mutex
|
||||
pthread_mutex_destroy(&statelist_cache_mutex);
|
||||
|
||||
maximum_states = 0;
|
||||
for (statelist_t *sl = candidates; sl != NULL; sl = sl->next) {
|
||||
maximum_states += (uint64_t)sl->len[ODD_STATE] * sl->len[EVEN_STATE];
|
||||
|
|
Loading…
Reference in a new issue