From 43ee5e2b3a26ec1958312fe38524b49da353ad81 Mon Sep 17 00:00:00 2001 From: Kai Liu Date: Sun, 20 Oct 2013 22:02:05 -0700 Subject: [PATCH] Fix the valgrind error in newly added unittests for table stats Summary: Previous the newly added test called NewBloomFilter without releasing it at the end of the test, which resulted in memory leak and was detected by valgrind. Test Plan: Ran valgrind test. --- table/table_test.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/table/table_test.cc b/table/table_test.cc index 066b7362e..5ed8c7070 100644 --- a/table/table_test.cc +++ b/table/table_test.cc @@ -906,7 +906,10 @@ TEST(TableTest, FilterPolicyNameStats) { std::vector keys; KVMap kvmap; Options options; - options.filter_policy = NewBloomFilterPolicy(10); + std::unique_ptr filter_policy( + NewBloomFilterPolicy(10) + ); + options.filter_policy = filter_policy.get(); c.Finish(options, &keys, &kvmap); auto& stats = c.table()->GetTableStats();