Skip to content

Commit

Permalink
fix use after free
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderSinn committed Aug 27, 2024
1 parent 34d5508 commit 020166b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Src/Base/AMReX_BArena.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ amrex::BArena::alloc (std::size_t sz_)
void
amrex::BArena::free (void* pt)
{
std::free(pt);
m_profiler.free(pt);
std::free(pt);
}

bool
Expand Down
2 changes: 1 addition & 1 deletion Src/Base/AMReX_PArena.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ PArena::free (void* p)

#if defined (AMREX_GPU_STREAM_ALLOC_SUPPORT)
if (Gpu::Device::memoryPoolsSupported()) {
m_profiler.free(p);
AMREX_HIP_OR_CUDA(
AMREX_HIP_SAFE_CALL(hipFreeAsync(p, Gpu::gpuStream()));,
AMREX_CUDA_SAFE_CALL(cudaFreeAsync(p, Gpu::gpuStream()));
)
m_profiler.free(p);
} else
#endif
{
Expand Down

0 comments on commit 020166b

Please sign in to comment.