mirror of
https://github.com/hashcat/hashcat.git
synced 2024-11-22 16:18:09 +00:00
OpenCL Kernel: Move kernel binary buffer from heap to stack memory
This commit is contained in:
parent
259f8f6bb2
commit
302f528796
@ -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
|
||||
|
20
src/opencl.c
20
src/opencl.c
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user