From a843df668bc14c6d549216fcfe9a7b8280f3f18b Mon Sep 17 00:00:00 2001 From: Yi Wu Date: Wed, 13 Sep 2017 15:56:57 -0700 Subject: [PATCH] Fix use-after-free in c_tset Summary: Fix asan error introduce by #2823 Closes https://github.com/facebook/rocksdb/pull/2879 Differential Revision: D5828454 Pulled By: yiwu-arbug fbshipit-source-id: 50777855667f4e7b634279a654c3bfa01a1ac729 --- db/c_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/c_test.c b/db/c_test.c index 2af50b20e..ecec090e0 100644 --- a/db/c_test.c +++ b/db/c_test.c @@ -1549,7 +1549,6 @@ int main(int argc, char** argv) { rocksdb_column_family_handle_destroy(cfh1); rocksdb_column_family_handle_destroy(cfh2); rocksdb_optimistictransactiondb_close_base_db(db); - rocksdb_optimistictransaction_options_destroy(otxn_options); rocksdb_optimistictransactiondb_close(otxn_db); // Check open optimistic transaction db with column families @@ -1585,6 +1584,7 @@ int main(int argc, char** argv) { rocksdb_optimistictransactiondb_close(otxn_db); rocksdb_destroy_db(db_options, dbname, &err); rocksdb_options_destroy(db_options); + rocksdb_optimistictransaction_options_destroy(otxn_options); CheckNoError(err); }