1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-23 00:28:11 +00:00

OpenCL Kernel: Move kernel binary buffer from heap to stack memory

This commit is contained in:
jsteube 2017-02-14 16:51:03 +01:00
parent 259f8f6bb2
commit 302f528796
2 changed files with 13 additions and 8 deletions

View File

@ -69,6 +69,7 @@
- Hardware Monitor: Fixed several memory leaks in case hash-file writing (caused by --remove) failed
- Mask Increment: Fixed memory leak in case mask_append() fails
- OpenCL Device Management: Fixed several memory leaks in case initialization of an OpenCL device or platform failed
- OpenCL Kernel: Move kernel binary buffer from heap to stack memory
- Outfile Check: Fixed a memory leak for failed outfile reads
- Rule Engine: Fixed several memory leaks in case loading of rules failed
- Session Management: Fixed several memory leaks in case profile- or install-folder setup failed

View File

@ -4115,9 +4115,13 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
* kernel compile or load
*/
size_t *kernel_lengths = (size_t *) hcmalloc (sizeof (size_t));
size_t kernel_lengths_buf = 0;
char **kernel_sources = (char **) hcmalloc (sizeof (char *));
size_t *kernel_lengths = &kernel_lengths_buf;
char *kernel_sources_buf = NULL;
char **kernel_sources = &kernel_sources_buf;
if (cached == false)
{
@ -4200,9 +4204,7 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
if (CL_rc == -1) return -1;
}
hcfree (kernel_lengths);
hcfree (kernel_sources[0]);
hcfree (kernel_sources);
}
/**
@ -4254,9 +4256,13 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
* kernel compile or load
*/
size_t *kernel_lengths = (size_t *) hcmalloc (sizeof (size_t));
size_t kernel_lengths_buf = 0;
char **kernel_sources = (char **) hcmalloc (sizeof (char *));
size_t *kernel_lengths = &kernel_lengths_buf;
char *kernel_sources_buf = NULL;
char **kernel_sources = &kernel_sources_buf;
if (cached == false)
{
@ -4339,9 +4345,7 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
if (CL_rc == -1) return -1;
}
hcfree (kernel_lengths);
hcfree (kernel_sources[0]);
hcfree (kernel_sources);
}
// return back to the folder we came from initially (workaround)