From bdb5edad3466b9d87d80b74239f5a6ca0d93bc7d Mon Sep 17 00:00:00 2001 From: Sean Keely Date: Fri, 13 Oct 2017 23:45:10 -0500 Subject: [PATCH] Fix memory leak in exception path. Change-Id: Iad5f035cd1909be4a8f1a1f5dd7ca5abec0694b4 [ROCm/ROCR-Runtime commit: 737966eb25e3900ae82c4cb8feeeaddd13ed17e6] --- .../runtime/hsa-runtime/core/runtime/amd_memory_region.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_memory_region.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_memory_region.cpp index a38689443b..d87ecd7d11 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_memory_region.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_memory_region.cpp @@ -649,7 +649,7 @@ void* MemoryRegion::BlockAllocator::alloc(size_t request_size, size_t& allocated hsa_status_t err = region_.Allocate( bsize, core::MemoryRegion::AllocateRestrict | core::MemoryRegion::AllocateDirect, &ret); if (err != HSA_STATUS_SUCCESS) - throw new ::AMD::hsa_exception(err, "MemoryRegion::BlockAllocator::alloc failed."); + throw ::AMD::hsa_exception(err, "MemoryRegion::BlockAllocator::alloc failed."); assert(ret != nullptr && "Region returned nullptr on success."); allocated_size = block_size();