diff --git a/include/data.h b/include/data.h index fdd1680b8..3f3bf8edb 100644 --- a/include/data.h +++ b/include/data.h @@ -6,18 +6,4 @@ #ifndef _DATA_H #define _DATA_H -#define global_free(attr) \ -{ \ - myfree ((void *) data.attr); \ - \ - data.attr = NULL; \ -} - -#define local_free(attr) \ -{ \ - myfree ((void *) attr); \ - \ - attr = NULL; \ -} - #endif // _DATA_H diff --git a/src/hashcat.c b/src/hashcat.c index 3dbef4761..67eeeaa60 100644 --- a/src/hashcat.c +++ b/src/hashcat.c @@ -763,7 +763,7 @@ static int inner1_loop (user_options_t *user_options, user_options_extra_t *user } } - local_free (dictionary_files); + myfree (dictionary_files); } } @@ -1009,7 +1009,7 @@ static int inner1_loop (user_options_t *user_options, user_options_extra_t *user } } - local_free (dictionary_files); + myfree (dictionary_files); } } @@ -1096,7 +1096,7 @@ static int inner1_loop (user_options_t *user_options, user_options_extra_t *user } } - local_free (dictionary_files); + myfree (dictionary_files); } } @@ -1590,7 +1590,7 @@ static int inner1_loop (user_options_t *user_options, user_options_extra_t *user hc_thread_wait (opencl_ctx->devices_cnt, c_threads); - local_free (c_threads); + myfree (c_threads); if ((opencl_ctx->devices_status != STATUS_CRACKED) && (opencl_ctx->devices_status != STATUS_ABORTED) @@ -1679,9 +1679,9 @@ static int inner1_loop (user_options_t *user_options, user_options_extra_t *user // free memory - global_free (words_progress_done); - global_free (words_progress_rejected); - global_free (words_progress_restored); + myfree (words_progress_done); + myfree (words_progress_rejected); + myfree (words_progress_restored); return 0; } @@ -1706,7 +1706,7 @@ static int outer_loop (user_options_t *user_options, user_options_extra_t *user_ /* if (algorithm_pos > 0) { - local_free (rd); + myfree (rd); rd = init_restore (argc, argv, user_options); @@ -2803,7 +2803,7 @@ int main (int argc, char **argv) return -1; } - local_free (performance_state); + myfree (performance_state); } // set powertune value only @@ -3000,7 +3000,7 @@ int main (int argc, char **argv) hc_thread_wait (1, &outer_threads[thread_idx]); } - local_free (outer_threads); + myfree (outer_threads); if (user_options->benchmark == true) { @@ -3104,7 +3104,7 @@ int main (int argc, char **argv) return -1; } - local_free (performance_state); + myfree (performance_state); } } } diff --git a/src/opencl.c b/src/opencl.c index a1f7b77d6..e290c8b43 100644 --- a/src/opencl.c +++ b/src/opencl.c @@ -3298,7 +3298,7 @@ int opencl_session_begin (opencl_ctx_t *opencl_ctx, const hashconfig_t *hashconf writeProgramBin (cached_file, binary, binary_size); - local_free (binary); + myfree (binary); } else { @@ -3413,9 +3413,9 @@ int opencl_session_begin (opencl_ctx_t *opencl_ctx, const hashconfig_t *hashconf } } - local_free (kernel_lengths); - local_free (kernel_sources[0]); - local_free (kernel_sources); + myfree (kernel_lengths); + myfree (kernel_sources[0]); + myfree (kernel_sources); } /** @@ -3561,7 +3561,7 @@ int opencl_session_begin (opencl_ctx_t *opencl_ctx, const hashconfig_t *hashconf writeProgramBin (cached_file, binary, binary_size); - local_free (binary); + myfree (binary); } else { @@ -3590,9 +3590,9 @@ int opencl_session_begin (opencl_ctx_t *opencl_ctx, const hashconfig_t *hashconf } } - local_free (kernel_lengths); - local_free (kernel_sources[0]); - local_free (kernel_sources); + myfree (kernel_lengths); + myfree (kernel_sources[0]); + myfree (kernel_sources); } /** @@ -3742,7 +3742,7 @@ int opencl_session_begin (opencl_ctx_t *opencl_ctx, const hashconfig_t *hashconf writeProgramBin (cached_file, binary, binary_size); - local_free (binary); + myfree (binary); } else { @@ -3771,9 +3771,9 @@ int opencl_session_begin (opencl_ctx_t *opencl_ctx, const hashconfig_t *hashconf } } - local_free (kernel_lengths); - local_free (kernel_sources[0]); - local_free (kernel_sources); + myfree (kernel_lengths); + myfree (kernel_sources[0]); + myfree (kernel_sources); } // return back to the folder we came from initially (workaround) diff --git a/src/outfile_check.c b/src/outfile_check.c index 9fb91eafb..02c220052 100644 --- a/src/outfile_check.c +++ b/src/outfile_check.c @@ -129,8 +129,8 @@ void *thread_outfile_remove (void *p) } } - local_free (out_info); - local_free (out_files); + myfree (out_info); + myfree (out_files); out_files = out_files_new; out_cnt = out_cnt_new; @@ -319,15 +319,15 @@ void *thread_outfile_remove (void *p) } } - if (esalt_size) local_free (hash_buf.esalt); + if (esalt_size) myfree (hash_buf.esalt); - if (is_salted) local_free (hash_buf.salt); + if (is_salted) myfree (hash_buf.salt); - local_free (hash_buf.digest); + myfree (hash_buf.digest); - local_free (out_info); + myfree (out_info); - local_free (out_files); + myfree (out_files); p = NULL;