Skip to content

Commit

Permalink
fix memory leaking in test_env_mat_a_mix.cc (#2596)
Browse files Browse the repository at this point in the history
`new[]` should be used with `delete[]`.

---------

Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
  • Loading branch information
njzjz committed Jun 7, 2023
1 parent a3c8980 commit 4b822b8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/lib/tests/test_env_mat_a_mix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ TEST_F(TestEnvMatAMix, prod_cpu) {
EXPECT_EQ(nmask[ii * nnei + jj], expected_nmask[ii * nnei + jj]);
}
}
free(nmask);
delete[] nmask;
}

TEST_F(TestEnvMatAMix, prod_cpu_equal_cpu) {
Expand Down Expand Up @@ -721,7 +721,7 @@ TEST_F(TestEnvMatAMix, prod_gpu_cuda) {
EXPECT_EQ(nmask[ii * nnei + jj], expected_nmask[ii * nnei + jj]);
}
}
free(nmask);
delete[] nmask;
}

TEST_F(TestEnvMatAMix, prod_gpu_cuda_equal_cpu) {
Expand Down Expand Up @@ -939,7 +939,7 @@ TEST_F(TestEnvMatAMix, prod_gpu_rocm) {
EXPECT_EQ(nmask[ii * nnei + jj], expected_nmask[ii * nnei + jj]);
}
}
free(nmask);
delete[] nmask;
}

TEST_F(TestEnvMatAMix, prod_gpu_rocm_equal_cpu) {
Expand Down

0 comments on commit 4b822b8

Please sign in to comment.