From 99f5a800c3efe7e088a53496ed7891a58839f98f Mon Sep 17 00:00:00 2001 From: Akanksha Mahajan Date: Wed, 16 Dec 2020 21:32:00 -0800 Subject: [PATCH] Fix clang_analyze error (#7777) Summary: Fix clang_analyze error Pull Request resolved: https://github.com/facebook/rocksdb/pull/7777 Test Plan: USE_CLANG=1 TEST_TMPDIR=/dev/shm/rocksdb OPT=-g make -j64 analyze Reviewed By: jay-zhuang Differential Revision: D25601675 Pulled By: akankshamahajan15 fbshipit-source-id: 30f58cf4d575a2d546c455fb43e856455eb72a07 --- utilities/transactions/transaction_test.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/utilities/transactions/transaction_test.cc b/utilities/transactions/transaction_test.cc index 1dc2ef362c..9c4ce5604a 100644 --- a/utilities/transactions/transaction_test.cc +++ b/utilities/transactions/transaction_test.cc @@ -5893,6 +5893,7 @@ TEST_P(TransactionTest, DuplicateKeys) { std::vector handles; ASSERT_OK(ReOpenNoDelete(cfds, &handles)); + assert(db != nullptr); ASSERT_OK(db->Put(write_options, "foo0", "init")); ASSERT_OK(db->Put(write_options, "foo1", "init")); ASSERT_OK(db->Put(write_options, handles[1], "foo0", "init")); @@ -6194,6 +6195,7 @@ TEST_P(TransactionTest, DoubleCrashInRecovery) { column_families.push_back( ColumnFamilyDescriptor("two", ColumnFamilyOptions())); ASSERT_OK(ReOpenNoDelete(column_families, &handles)); + assert(db != nullptr); if (write_after_recovery) { // Write data to the log right after the corrupted log