Merge pull request #396

93aadbd unit_tests: initialize a field to silence a valgrind report (moneromooo-monero)
b0a98b2 unit_tests: initialize enough to silence valgrind (moneromooo-monero)
555d90b berkeleydb: fix delete/free mismatch (moneromooo-monero)
This commit is contained in:
Riccardo Spagni 2015-09-07 10:37:09 +02:00
commit b0eec52b5a
No known key found for this signature in database
GPG Key ID: 55432DF31CCD4FCD
3 changed files with 5 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;

View File

@ -242,6 +242,7 @@ namespace
m_req_head.m_cb = m_in_data.size();
m_req_head.m_have_to_return_data = true;
m_req_head.m_command = expected_command;
m_req_head.m_return_code = 0;
m_req_head.m_flags = LEVIN_PACKET_REQUEST;
m_req_head.m_protocol_version = LEVIN_PROTOCOL_VER_1;

View File

@ -394,6 +394,8 @@ TEST(Serialization, serializes_transacion_signatures_correctly)
// Not enough signature vectors for all inputs
txin_to_key txin_to_key1;
txin_to_key1.amount = 1000000000000;
memset(txin_to_key1.k_image.data,0,32);
txin_to_key1.key_offsets.resize(2);
tx.vin.clear();
tx.vin.push_back(txin_to_key1);