mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 10:37:23 -07:00
fix: mem leaks.
This commit is contained in:
parent
06ade9970a
commit
91d6836a47
7 changed files with 22 additions and 14 deletions
|
@ -311,6 +311,11 @@ bool brute_force_bs(float *bf_rate, statelist_t *candidates, uint32_t cuid, uint
|
|||
|
||||
uint64_t start_time = msclock();
|
||||
|
||||
#if defined(__linux__) || defined(__APPLE__)
|
||||
if ( NUM_BRUTE_FORCE_THREADS < 0 )
|
||||
return false;
|
||||
#endif
|
||||
|
||||
pthread_t threads[NUM_BRUTE_FORCE_THREADS];
|
||||
struct args {
|
||||
bool silent;
|
||||
|
@ -322,7 +327,7 @@ bool brute_force_bs(float *bf_rate, statelist_t *candidates, uint32_t cuid, uint
|
|||
uint8_t *best_first_bytes;
|
||||
} thread_args[NUM_BRUTE_FORCE_THREADS];
|
||||
|
||||
for(uint32_t i = 0; i < NUM_BRUTE_FORCE_THREADS; i++){
|
||||
for (uint32_t i = 0; i < NUM_BRUTE_FORCE_THREADS; i++){
|
||||
thread_args[i].thread_ID = i;
|
||||
thread_args[i].silent = silent;
|
||||
thread_args[i].cuid = cuid;
|
||||
|
@ -332,7 +337,7 @@ bool brute_force_bs(float *bf_rate, statelist_t *candidates, uint32_t cuid, uint
|
|||
thread_args[i].best_first_bytes = best_first_bytes;
|
||||
pthread_create(&threads[i], NULL, crack_states_thread, (void*)&thread_args[i]);
|
||||
}
|
||||
for(uint32_t i = 0; i < NUM_BRUTE_FORCE_THREADS; i++){
|
||||
for (uint32_t i = 0; i < NUM_BRUTE_FORCE_THREADS; i++){
|
||||
pthread_join(threads[i], 0);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue