From 90cd6c2bb17a54e97c32856254fd666c9cab8dc5 Mon Sep 17 00:00:00 2001 From: Zhongyi Xie Date: Tue, 13 Aug 2019 21:51:42 -0700 Subject: [PATCH] Fix double deletion in transaction_test (#5700) Summary: Fix the following clang analyze failures: ``` In file included from utilities/transactions/transaction_test.cc:8: ./utilities/transactions/transaction_test.h:174:14: warning: Attempt to delete released memory delete root_db; ^ ``` The destructor of StackableDB already deletes the root db and there is no need to delete the db separately. Pull Request resolved: https://github.com/facebook/rocksdb/pull/5700 Test Plan: USE_CLANG=1 TEST_TMPDIR=/dev/shm/rocksdb OPT=-g make -j24 analyze Differential Revision: D16800579 Pulled By: maysamyabandeh fbshipit-source-id: 64c2d70f23e07e6a15242add97c744902ea33be5 --- utilities/transactions/transaction_test.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/utilities/transactions/transaction_test.h b/utilities/transactions/transaction_test.h index abfa7d8a9..03bfb6537 100644 --- a/utilities/transactions/transaction_test.h +++ b/utilities/transactions/transaction_test.h @@ -170,8 +170,6 @@ class TransactionTestBase : public ::testing::Test { } if (!s.ok()) { delete stackable_db; - // just in case it was not deleted (and not set to nullptr). - delete root_db; } return s; } @@ -207,8 +205,6 @@ class TransactionTestBase : public ::testing::Test { delete handles[0]; if (!s.ok()) { delete stackable_db; - // just in case it was not deleted (and not set to nullptr). - delete root_db; } return s; }