Skip to content

Commit f723b2f

Browse files
committed
Fixed coverity issue in acl_mem.cpp: Memory leak
1 parent 0b12096 commit f723b2f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/acl_mem.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4169,6 +4169,7 @@ ACL_EXPORT CL_API_ENTRY cl_int CL_API_CALL clEnqueueMigrateMemObjectsIntelFPGA(
41694169
num_mem_objects * sizeof(acl_mem_migrate_wrapper_t));
41704170

41714171
if (!new_src_mem_list) {
4172+
free(needs_release_on_fail);
41724173
return CL_OUT_OF_RESOURCES;
41734174
}
41744175

@@ -4179,6 +4180,7 @@ ACL_EXPORT CL_API_ENTRY cl_int CL_API_CALL clEnqueueMigrateMemObjectsIntelFPGA(
41794180
num_mem_objects * sizeof(acl_mem_migrate_wrapper_t));
41804181

41814182
if (!local_event->cmd.info.memory_migration.src_mem_list) {
4183+
free(needs_release_on_fail);
41824184
return CL_OUT_OF_RESOURCES;
41834185
}
41844186
}

0 commit comments

Comments
 (0)