diff --git a/include/folder.h b/include/folder.h index 5d3ce074f..f850ec276 100644 --- a/include/folder.h +++ b/include/folder.h @@ -38,7 +38,7 @@ int count_dictionaries (char **dictionary_files); char **scan_directory (const char *path); -int folder_config_init (folder_config_t *folder_config, const char *install_folder, const char *shared_folder); -void folder_config_destroy (folder_config_t *folder_config); +int folder_config_init (hashcat_ctx_t *hashcat_ctx, const char *install_folder, const char *shared_folder); +void folder_config_destroy (hashcat_ctx_t *hashcat_ctx); int hc_mkdir (const char *name, int mode); diff --git a/src/folder.c b/src/folder.c index 2467a8843..368df70c8 100644 --- a/src/folder.c +++ b/src/folder.c @@ -236,8 +236,10 @@ char **scan_directory (const char *path) return (files); } -int folder_config_init (folder_config_t *folder_config, const char *install_folder, const char *shared_folder) +int folder_config_init (hashcat_ctx_t *hashcat_ctx, const char *install_folder, const char *shared_folder) { + folder_config_t *folder_config = hashcat_ctx->folder_config; + /** * There's some buggy OpenCL runtime that do not support -I. * A workaround is to chdir() to the OpenCL folder, @@ -411,8 +413,10 @@ int folder_config_init (folder_config_t *folder_config, const char *install_fold return 0; } -void folder_config_destroy (folder_config_t *folder_config) +void folder_config_destroy (hashcat_ctx_t *hashcat_ctx) { + folder_config_t *folder_config = hashcat_ctx->folder_config; + myfree (folder_config->cpath_real); myfree (folder_config->cwd); myfree (folder_config->install_dir); diff --git a/src/hashcat.c b/src/hashcat.c index 9642021d2..21b81620e 100644 --- a/src/hashcat.c +++ b/src/hashcat.c @@ -1260,7 +1260,7 @@ int hashcat (hashcat_ctx_t *hashcat_ctx, char *install_folder, char *shared_fold * folder */ - folder_config_init (folder_config, install_folder, shared_folder); + folder_config_init (hashcat_ctx, install_folder, shared_folder); /** * restore @@ -1507,7 +1507,7 @@ int hashcat (hashcat_ctx_t *hashcat_ctx, char *install_folder, char *shared_fold outcheck_ctx_destroy (outcheck_ctx); - folder_config_destroy (folder_config); + folder_config_destroy (hashcat_ctx); user_options_extra_destroy (user_options_extra);