From 8621871e2ae905003fd26f436d6f0df463194608 Mon Sep 17 00:00:00 2001 From: Luc Grosheintz Date: Sat, 30 Nov 2024 18:39:34 +0100 Subject: [PATCH] Fix leak in test code. --- tests/unit/test_all_types.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/unit/test_all_types.cpp b/tests/unit/test_all_types.cpp index 0a18e0257..4d3ed0a0a 100644 --- a/tests/unit/test_all_types.cpp +++ b/tests/unit/test_all_types.cpp @@ -112,7 +112,8 @@ void check_read_regular(const std::string& file_name, const std::vector& using reference_type = typename testing::MultiDimVector::type; auto file = File(file_name, File::Truncate); - auto expected = testing::copy(traits::create(dims), dims); + auto raw_expected = traits::create(dims); + auto expected = testing::copy(raw_expected, dims); auto dataspace = DataSpace(dims); auto attr = testing::AttributeCreateTraits::create(file, "dset", dataspace); @@ -139,6 +140,7 @@ void check_read_regular(const std::string& file_name, const std::vector& } testing::ContainerTraits::deallocate(expected, dims); + testing::ContainerTraits::deallocate(raw_expected, dims); } template