aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2015-09-02 18:16:26 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-02-03 08:49:11 +0000
commit3a0f4d8a57c61b6b4dc8a6bfbf4f31acf14bf328 (patch)
tree1cca2df01a068db284000f0fd1bd8b19d47925ed /src
parentminor bugfixes and refactoring (diff)
downloadmonero-3a0f4d8a57c61b6b4dc8a6bfbf4f31acf14bf328.tar.xz
berkeleydb: fix delete/free mismatch
Despite being C++, the stats object is allocated by the underlying C layer using malloc(3).
Diffstat (limited to 'src')
-rw-r--r--src/blockchain_db/berkeleydb/db_bdb.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/blockchain_db/berkeleydb/db_bdb.cpp b/src/blockchain_db/berkeleydb/db_bdb.cpp
index 832fb8f8d..6c80d1333 100644
--- a/src/blockchain_db/berkeleydb/db_bdb.cpp
+++ b/src/blockchain_db/berkeleydb/db_bdb.cpp
@@ -925,12 +925,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);
// checks for compatibility
bool compatible = true;