From b4fb544110631facf9e136025c2c4dc166dacbbe Mon Sep 17 00:00:00 2001 From: Aram Date: Sun, 8 May 2016 15:55:58 +0200 Subject: [PATCH] Free computed result at the last moment --- libnfc_crypto1_crack.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libnfc_crypto1_crack.c b/libnfc_crypto1_crack.c index 5fef25f..1e50539 100644 --- a/libnfc_crypto1_crack.c +++ b/libnfc_crypto1_crack.c @@ -503,14 +503,14 @@ bool stop_collection = false; void * update_predictions_thread(void* p){ while(!stop_collection){ if(nonces && uid){ + if(space){ + craptev1_destroy_space(space); + space = NULL; + } space = craptev1_get_space(nonces, 95, uid); } if(space){ total_states = craptev1_sizeof_space(space); - if(total_states > CUTOFF){ - craptev1_destroy_space(space); - space = NULL; - } } } return NULL; @@ -661,6 +661,8 @@ int main (int argc, const char * argv[]) { } if(space){ total_states = craptev1_sizeof_space(space); + } else { + total_states = 0; } if(!total_states){ fprintf(stderr, "No solution found :(\n");