Unverified Commit 99937422 authored by Kacper Pietkun's avatar Kacper Pietkun Committed by GitHub
Browse files

[Bugfix] fixed leak in SpMMCreateBlocks (#5210)

* fixed leak in SpMMCreateBlocks

* clang format
parent 45153fc0
......@@ -80,10 +80,16 @@ inline void SpMMCreateBlocks(
if (num_K_blocks > 1) {
IdType *indptr_block_buf = reinterpret_cast<IdType *>(aligned_alloc(
64, (M_block_size + 1) * num_M_blocks * num_K_blocks * sizeof(IdType)));
IdType *indices_block_buf = reinterpret_cast<IdType *>(
aligned_alloc(64, indptr[M] * sizeof(IdType)));
IdType *edges_block_buf = reinterpret_cast<IdType *>(
aligned_alloc(64, indptr[M] * sizeof(IdType)));
IdType *indices_block_buf = nullptr;
if (use_lhs) {
indices_block_buf = reinterpret_cast<IdType *>(
aligned_alloc(64, indptr[M] * sizeof(IdType)));
}
IdType *edges_block_buf = nullptr;
if (use_rhs) {
edges_block_buf = reinterpret_cast<IdType *>(
aligned_alloc(64, indptr[M] * sizeof(IdType)));
}
#pragma omp parallel
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment