Fix memory leak in exception path.

Change-Id: Iad5f035cd1909be4a8f1a1f5dd7ca5abec0694b4
Ta zmiana jest zawarta w:
%! (template.HTML=Sean Keely)złożyło 2017-10-21 11:08:00 -04:00
1 rodzic 5a3230af66
złożenie 737966eb25
Plik 1 zmieniony
+1 -1
+1 -1
Wyświetl plik
@@ -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();