From: Kai Liu Date: Mon, 21 Oct 2013 05:02:05 +0000 (-0700) Subject: Fix the valgrind error in newly added unittests for table stats X-Git-Tag: 2.5.fb~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=43ee5e2b3a26ec1958312fe38524b49da353ad81;p=rocksdb.git 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. --- 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();