From 8d9bf5c498f9dd50a11276cc48a35a362429c49c Mon Sep 17 00:00:00 2001 From: Yi Wu Date: Thu, 15 Sep 2016 14:57:32 -0700 Subject: [PATCH] Fix DBOptionsTest.GetLatestOptions Summary: RandomInitCFOptions will allocate a new compaction filter, which we have to delete afterward. Test Plan: valgrind against the test Reviewers: IslamAbdelRahman Reviewed By: IslamAbdelRahman Subscribers: andrewkr, dhruba, leveldb Differential Revision: https://reviews.facebook.net/D64011 --- db/db_options_test.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/db/db_options_test.cc b/db/db_options_test.cc index b5b017a56..ccc65363e 100644 --- a/db/db_options_test.cc +++ b/db/db_options_test.cc @@ -47,7 +47,9 @@ class DBOptionsTest : public DBTestBase { Options options; test::RandomInitCFOptions(&options, rnd); auto sanitized_options = SanitizeOptions(options, nullptr, options); - return GetMutableCFOptionsMap(sanitized_options); + auto opt_map = GetMutableCFOptionsMap(sanitized_options); + delete options.compaction_filter; + return opt_map; } #endif // ROCKSDB_LITE };