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
main
Zhongyi Xie 5 years ago committed by Facebook Github Bot
parent 8a678a50ba
commit 90cd6c2bb1
  1. 4
      utilities/transactions/transaction_test.h

@ -170,8 +170,6 @@ class TransactionTestBase : public ::testing::Test {
} }
if (!s.ok()) { if (!s.ok()) {
delete stackable_db; delete stackable_db;
// just in case it was not deleted (and not set to nullptr).
delete root_db;
} }
return s; return s;
} }
@ -207,8 +205,6 @@ class TransactionTestBase : public ::testing::Test {
delete handles[0]; delete handles[0];
if (!s.ok()) { if (!s.ok()) {
delete stackable_db; delete stackable_db;
// just in case it was not deleted (and not set to nullptr).
delete root_db;
} }
return s; return s;
} }

Loading…
Cancel
Save