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:
parent
cf88e4dd24
commit
555d90b2c9
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue