From e7e16d00afeba35c4a11a595b740fc17337c7ace Mon Sep 17 00:00:00 2001 From: jsteube Date: Mon, 4 Mar 2019 11:34:56 +0100 Subject: [PATCH] Fix memory buffer double free --- src/opencl.c | 139 ++++++++++++++++++++++++++------------------------- 1 file changed, 72 insertions(+), 67 deletions(-) diff --git a/src/opencl.c b/src/opencl.c index db674227d..ccd9a83e2 100644 --- a/src/opencl.c +++ b/src/opencl.c @@ -6854,74 +6854,79 @@ void opencl_session_destroy (hashcat_ctx_t *hashcat_ctx) if (device_param->context) hc_clReleaseContext (hashcat_ctx, device_param->context); - device_param->pws_comp = NULL; - device_param->pws_idx = NULL; - device_param->pws_pre_buf = NULL; - device_param->pws_base_buf = NULL; - device_param->combs_buf = NULL; - device_param->hooks_buf = NULL; + device_param->pws_comp = NULL; + device_param->pws_idx = NULL; + device_param->pws_pre_buf = NULL; + device_param->pws_base_buf = NULL; + device_param->combs_buf = NULL; + device_param->hooks_buf = NULL; + device_param->scratch_buf = NULL; + #ifdef WITH_BRAIN + device_param->brain_link_in_buf = NULL; + device_param->brain_link_out_buf = NULL; + #endif - device_param->d_pws_buf = NULL; - device_param->d_pws_amp_buf = NULL; - device_param->d_pws_comp_buf = NULL; - device_param->d_pws_idx = NULL; - device_param->d_rules = NULL; - device_param->d_rules_c = NULL; - device_param->d_combs = NULL; - device_param->d_combs_c = NULL; - device_param->d_bfs = NULL; - device_param->d_bfs_c = NULL; - device_param->d_bitmap_s1_a = NULL; - device_param->d_bitmap_s1_b = NULL; - device_param->d_bitmap_s1_c = NULL; - device_param->d_bitmap_s1_d = NULL; - device_param->d_bitmap_s2_a = NULL; - device_param->d_bitmap_s2_b = NULL; - device_param->d_bitmap_s2_c = NULL; - device_param->d_bitmap_s2_d = NULL; - device_param->d_plain_bufs = NULL; - device_param->d_digests_buf = NULL; - device_param->d_digests_shown = NULL; - device_param->d_salt_bufs = NULL; - device_param->d_esalt_bufs = NULL; - device_param->d_tmps = NULL; - device_param->d_hooks = NULL; - device_param->d_result = NULL; - device_param->d_extra0_buf = NULL; - device_param->d_extra1_buf = NULL; - device_param->d_extra2_buf = NULL; - device_param->d_extra3_buf = NULL; - device_param->d_root_css_buf = NULL; - device_param->d_markov_css_buf = NULL; - device_param->d_tm_c = NULL; - device_param->d_st_digests_buf = NULL; - device_param->d_st_salts_buf = NULL; - device_param->d_st_esalts_buf = NULL; - device_param->kernel1 = NULL; - device_param->kernel12 = NULL; - device_param->kernel2 = NULL; - device_param->kernel23 = NULL; - device_param->kernel3 = NULL; - device_param->kernel4 = NULL; - device_param->kernel_init2 = NULL; - device_param->kernel_loop2 = NULL; - device_param->kernel_mp = NULL; - device_param->kernel_mp_l = NULL; - device_param->kernel_mp_r = NULL; - device_param->kernel_tm = NULL; - device_param->kernel_amp = NULL; - device_param->kernel_memset = NULL; - device_param->kernel_atinit = NULL; - device_param->kernel_decompress = NULL; - device_param->kernel_aux1 = NULL; - device_param->kernel_aux2 = NULL; - device_param->kernel_aux3 = NULL; - device_param->kernel_aux4 = NULL; - device_param->program = NULL; - device_param->program_mp = NULL; - device_param->program_amp = NULL; - device_param->command_queue = NULL; - device_param->context = NULL; + device_param->d_pws_buf = NULL; + device_param->d_pws_amp_buf = NULL; + device_param->d_pws_comp_buf = NULL; + device_param->d_pws_idx = NULL; + device_param->d_rules = NULL; + device_param->d_rules_c = NULL; + device_param->d_combs = NULL; + device_param->d_combs_c = NULL; + device_param->d_bfs = NULL; + device_param->d_bfs_c = NULL; + device_param->d_bitmap_s1_a = NULL; + device_param->d_bitmap_s1_b = NULL; + device_param->d_bitmap_s1_c = NULL; + device_param->d_bitmap_s1_d = NULL; + device_param->d_bitmap_s2_a = NULL; + device_param->d_bitmap_s2_b = NULL; + device_param->d_bitmap_s2_c = NULL; + device_param->d_bitmap_s2_d = NULL; + device_param->d_plain_bufs = NULL; + device_param->d_digests_buf = NULL; + device_param->d_digests_shown = NULL; + device_param->d_salt_bufs = NULL; + device_param->d_esalt_bufs = NULL; + device_param->d_tmps = NULL; + device_param->d_hooks = NULL; + device_param->d_result = NULL; + device_param->d_extra0_buf = NULL; + device_param->d_extra1_buf = NULL; + device_param->d_extra2_buf = NULL; + device_param->d_extra3_buf = NULL; + device_param->d_root_css_buf = NULL; + device_param->d_markov_css_buf = NULL; + device_param->d_tm_c = NULL; + device_param->d_st_digests_buf = NULL; + device_param->d_st_salts_buf = NULL; + device_param->d_st_esalts_buf = NULL; + device_param->kernel1 = NULL; + device_param->kernel12 = NULL; + device_param->kernel2 = NULL; + device_param->kernel23 = NULL; + device_param->kernel3 = NULL; + device_param->kernel4 = NULL; + device_param->kernel_init2 = NULL; + device_param->kernel_loop2 = NULL; + device_param->kernel_mp = NULL; + device_param->kernel_mp_l = NULL; + device_param->kernel_mp_r = NULL; + device_param->kernel_tm = NULL; + device_param->kernel_amp = NULL; + device_param->kernel_memset = NULL; + device_param->kernel_atinit = NULL; + device_param->kernel_decompress = NULL; + device_param->kernel_aux1 = NULL; + device_param->kernel_aux2 = NULL; + device_param->kernel_aux3 = NULL; + device_param->kernel_aux4 = NULL; + device_param->program = NULL; + device_param->program_mp = NULL; + device_param->program_amp = NULL; + device_param->command_queue = NULL; + device_param->context = NULL; } }