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 1642be242d
commit 3a0f4d8a57
No known key found for this signature in database
GPG Key ID: 686F07454D6CEFC3

View File

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