berkeleydb: fix delete/free mismatch

Despite being C++, the stats object is allocated by the underlying
C layer using malloc(3).
This commit is contained in:
moneromooo-monero 2015-09-02 18:16:26 +01:00
parent cf88e4dd24
commit 555d90b2c9
No known key found for this signature in database
GPG Key ID: 686F07454D6CEFC3
1 changed files with 2 additions and 2 deletions

View File

@ -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;