1
0
mirror of https://github.com/hashcat/hashcat.git synced 2025-04-07 18:25:42 +00:00

Get rid of local_free() and global_free(), no longer required

This commit is contained in:
jsteube 2016-09-26 23:22:07 +02:00
parent 9c27c35ac7
commit 75682a5008
4 changed files with 30 additions and 44 deletions

View File

@ -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

View File

@ -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);
}
}
}

View File

@ -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)

View File

@ -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;