1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-22 08:08:10 +00:00

Fix memleak in memory evaluation

This commit is contained in:
jsteube 2018-08-06 10:25:19 +02:00
parent f9b13035f2
commit 242d991def

View File

@ -4298,7 +4298,12 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
tmp_device[c] = ocl->clCreateBuffer (device_param->context, CL_MEM_READ_WRITE, MAX_ALLOC_CHECKS_SIZE, NULL, &CL_err);
if (CL_err != CL_SUCCESS) break;
if (CL_err != CL_SUCCESS)
{
c--;
break;
}
CL_err = ocl->clEnqueueReadBuffer (device_param->command_queue, tmp_device[c], CL_TRUE, 0, MAX_ALLOC_CHECKS_SIZE, tmp_host, 0, NULL, NULL);
@ -4309,8 +4314,6 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
if (CL_err != CL_SUCCESS) break;
}
if (c >= 1) c--;
device_param->device_available_mem = c * MAX_ALLOC_CHECKS_SIZE;
// clean up