diff --git a/src/opencl_rawmd5_fmt.c b/src/opencl_rawmd5_fmt.c index 05154a4..e71d15e 100644 --- a/src/opencl_rawmd5_fmt.c +++ b/src/opencl_rawmd5_fmt.c @@ -137,7 +137,11 @@ static void create_clobj(int kpc, struct fmt_main * self) static void release_clobj(void) { - HANDLE_CLERROR(clEnqueueUnmapMemObject(queue[ocl_gpu_id], pinned_partial_hashes, partial_hashes, 0,NULL,NULL), "Error Unmapping partial_hashes"); + if (!mask_mode) + HANDLE_CLERROR(clEnqueueUnmapMemObject(queue[ocl_gpu_id], pinned_partial_hashes, partial_hashes, 0,NULL,NULL), "Error Unmapping partial_hashes"); + else + MEM_FREE(partial_hashes); + HANDLE_CLERROR(clEnqueueUnmapMemObject(queue[ocl_gpu_id], pinned_saved_keys, saved_plain, 0, NULL, NULL), "Error Unmapping saved_plain"); HANDLE_CLERROR(clEnqueueUnmapMemObject(queue[ocl_gpu_id], pinned_saved_idx, saved_idx, 0, NULL, NULL), "Error Unmapping saved_idx"); @@ -309,7 +313,9 @@ static void opencl_md5_reset(struct db_main *db) { db->format->params.min_keys_per_crypt = db->format->params.max_keys_per_crypt; + HANDLE_CLERROR(clEnqueueUnmapMemObject(queue[ocl_gpu_id], pinned_partial_hashes, partial_hashes, 0,NULL,NULL), "Error Unmapping partial_hashes"); loaded_hashes = (unsigned int*)mem_alloc(((db->password_count) * 4 + 1)*sizeof(unsigned int)); + partial_hashes = (unsigned int*)mem_alloc(((db->password_count) * 4 + 1)*sizeof(unsigned int)); outKeyIdx = (unsigned int*)mem_alloc((db->password_count) * sizeof(unsigned int) * 2); mask_offsets = (unsigned char*) mem_calloc(db->format->params.max_keys_per_crypt); bitmap1 = (struct bitmap_context_mixed*)mem_alloc(sizeof(struct bitmap_context_mixed));