Skip to content

Commit

Permalink
fix memory leak in sz operator
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonRuonanWang committed Mar 25, 2022
1 parent e7fa9ac commit d6b5f92
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions source/adios2/operator/compress/CompressSZ.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ size_t CompressSZ::DecompressV1(const char *bufferIn, const size_t sizeIn,
std::memcpy(dataOut, result, dataSizeBytes);
free(result);
result = nullptr;
SZ_Finalize();
return dataSizeBytes;
}

Expand Down Expand Up @@ -477,6 +478,7 @@ size_t CompressSZ::DecompressV2(const char *bufferIn, const size_t sizeIn,
std::memcpy(dataOut, result, dataSizeBytes);
free(result);
result = nullptr;
SZ_Finalize();
return dataSizeBytes;
}

Expand Down
2 changes: 1 addition & 1 deletion testing/adios2/engine/dataman/TestDataMan2DSz.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ TEST_F(DataManEngineTest, 2D_Sz)
Dims start = {0, 0};
Dims count = {10, 10};

size_t steps = 50;
size_t steps = 5000;
adios2::Params engineParams = {
{"IPAddress", "127.0.0.1"}, {"Port", "12330"}, {"Verbose", "0"}};

Expand Down

0 comments on commit d6b5f92

Please sign in to comment.