From 04dbbebc62d72c287be5faf73b636d6199c73614 Mon Sep 17 00:00:00 2001 From: jsteube Date: Fri, 23 Sep 2016 22:01:43 +0200 Subject: [PATCH] Move hashconfig initialization to first inner loop --- src/hashcat.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/hashcat.c b/src/hashcat.c index 96a60b530..9c111c49e 100644 --- a/src/hashcat.c +++ b/src/hashcat.c @@ -427,13 +427,9 @@ int main (int argc, char **argv) } /** - * config + * outer loop */ - hashconfig_t *hashconfig = (hashconfig_t *) mymalloc (sizeof (hashconfig_t)); - - data.hashconfig = hashconfig; - uint algorithm_pos = 0; uint algorithm_max = 1; @@ -483,6 +479,10 @@ int main (int argc, char **argv) * setup variables and buffers depending on hash_mode */ + hashconfig_t *hashconfig = (hashconfig_t *) mymalloc (sizeof (hashconfig_t)); + + data.hashconfig = hashconfig; + const int rc_hashconfig = hashconfig_init (hashconfig, user_options); if (rc_hashconfig == -1) return -1; @@ -3689,6 +3689,8 @@ int main (int argc, char **argv) hashes_destroy (hashes); + hashconfig_destroy (hashconfig); + local_free (all_kernel_rules_cnt); local_free (all_kernel_rules_buf); @@ -3729,14 +3731,16 @@ int main (int argc, char **argv) local_free (rd); - hashconfig_destroy (hashconfig); - tuning_db_destroy (tuning_db); induct_ctx_destroy (induct_ctx); outcheck_ctx_destroy (outcheck_ctx); + folder_config_destroy (folder_config); + + user_options_extra_destroy (user_options_extra); + time_t proc_stop; time (&proc_stop); @@ -3753,6 +3757,8 @@ int main (int argc, char **argv) if (user_options->quiet == false) log_info_nn ("Started: %s", ctime (&proc_start)); if (user_options->quiet == false) log_info_nn ("Stopped: %s", ctime (&proc_stop)); + user_options_destroy (user_options); + u32 rc_final = -1; if (opencl_ctx->devices_status == STATUS_ABORTED) rc_final = 2; @@ -3762,11 +3768,5 @@ int main (int argc, char **argv) opencl_ctx_destroy (opencl_ctx); - folder_config_destroy (folder_config); - - user_options_extra_destroy (user_options_extra); - - user_options_destroy (user_options); - return rc_final; }