Skip to content

Commit

Permalink
event: resolve memory leak in ndrange_kernel memory_migration struct
Browse files Browse the repository at this point in the history
  • Loading branch information
sophimao authored and pcolberg committed Aug 18, 2022
1 parent 2c69880 commit 1847ee9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/acl_event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,13 @@ static void l_release_command_resources(acl_command_info_t &cmd) {

case CL_COMMAND_TASK:
case CL_COMMAND_NDRANGE_KERNEL:
if (cmd.info.ndrange_kernel.memory_migration.num_mem_objects != 0 &&
cmd.info.ndrange_kernel.memory_migration.src_mem_list) {
// src_mem should be user-provided buffers, users are responsible for
// releasing them Just free the src memory list here
acl_free(cmd.info.ndrange_kernel.memory_migration.src_mem_list);
cmd.info.ndrange_kernel.memory_migration.src_mem_list = nullptr;
}
// Cleanup is handled via the completion callback.
break;

Expand Down

0 comments on commit 1847ee9

Please sign in to comment.