From 555d90b2c95f3d624bbd48daed2ce6268af656e9 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Wed, 2 Sep 2015 18:16:26 +0100 Subject: [PATCH] berkeleydb: fix delete/free mismatch Despite being C++, the stats object is allocated by the underlying C layer using malloc(3). --- src/blockchain_db/berkeleydb/db_bdb.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/blockchain_db/berkeleydb/db_bdb.cpp b/src/blockchain_db/berkeleydb/db_bdb.cpp index a990d7aaf..7f3f32628 100644 --- a/src/blockchain_db/berkeleydb/db_bdb.cpp +++ b/src/blockchain_db/berkeleydb/db_bdb.cpp @@ -726,12 +726,12 @@ void BlockchainBDB::open(const std::string& filename, const int db_flags) // to zero (0) for reliability. m_blocks->stat(NULL, &stats, 0); m_height = stats->bt_nkeys; - delete stats; + free(stats); // see above comment about DB_FAST_STAT m_output_indices->stat(NULL, &stats, 0); m_num_outputs = stats->bt_nkeys; - delete stats; + free(stats); // run checkpoint thread m_run_checkpoint = true;