From 0edc7818619fbcfb5d2d322f7121a10409f55488 Mon Sep 17 00:00:00 2001 From: jsteube Date: Tue, 27 Sep 2016 11:03:45 +0200 Subject: [PATCH] Move words_progress_* down one level --- src/hashcat.c | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/src/hashcat.c b/src/hashcat.c index fbf149660..5662177b5 100644 --- a/src/hashcat.c +++ b/src/hashcat.c @@ -1139,18 +1139,6 @@ static int inner1_loop (user_options_t *user_options, user_options_extra_t *user } } - /** - * keep track of the progress - */ - - u64 *words_progress_done = (u64 *) mycalloc (hashes->salts_cnt, sizeof (u64)); - u64 *words_progress_rejected = (u64 *) mycalloc (hashes->salts_cnt, sizeof (u64)); - u64 *words_progress_restored = (u64 *) mycalloc (hashes->salts_cnt, sizeof (u64)); - - data.words_progress_done = words_progress_done; - data.words_progress_rejected = words_progress_rejected; - data.words_progress_restored = words_progress_restored; - /** * main inner loop */ @@ -1657,9 +1645,6 @@ static int inner1_loop (user_options_t *user_options, user_options_extra_t *user // free memory - myfree (words_progress_done); - myfree (words_progress_rejected); - myfree (words_progress_restored); return 0; } @@ -1909,6 +1894,14 @@ static int outer_loop (user_options_t *user_options, user_options_extra_t *user_ if (user_options->quiet == false) log_info_nn ("Initializing device kernels and memory..."); + u64 *words_progress_done = (u64 *) mycalloc (hashes->salts_cnt, sizeof (u64)); + u64 *words_progress_rejected = (u64 *) mycalloc (hashes->salts_cnt, sizeof (u64)); + u64 *words_progress_restored = (u64 *) mycalloc (hashes->salts_cnt, sizeof (u64)); + + data.words_progress_done = words_progress_done; + data.words_progress_rejected = words_progress_rejected; + data.words_progress_restored = words_progress_restored; + /* session_ctx_t *session_ctx = (session_ctx_t *) mymalloc (sizeof (session_ctx_t)); @@ -2139,6 +2132,10 @@ static int outer_loop (user_options_t *user_options, user_options_extra_t *user_ * Clean up */ + myfree (words_progress_done); + myfree (words_progress_rejected); + myfree (words_progress_restored); + opencl_session_destroy (opencl_ctx); potfile_write_close (potfile_ctx);