Make SafeDbt DB_DBT_MALLOC on default initialization

If we're constructing the SafeDbt without provided data, it is always malloced,
so that is the case we expose.

Also run clang-format.
This commit is contained in:
Ben Woosley
2018-11-24 20:49:08 -06:00
parent 1a9f9f7e5e
commit 4a86a0acd9
2 changed files with 12 additions and 10 deletions

View File

@@ -247,12 +247,12 @@ BerkeleyEnvironment::VerifyResult BerkeleyEnvironment::Verify(const std::string&
return (fRecovered ? VerifyResult::RECOVER_OK : VerifyResult::RECOVER_FAIL);
}
BerkeleyBatch::SafeDbt::SafeDbt(u_int32_t flags)
BerkeleyBatch::SafeDbt::SafeDbt()
{
m_dbt.set_flags(flags);
m_dbt.set_flags(DB_DBT_MALLOC);
}
BerkeleyBatch::SafeDbt::SafeDbt(void *data, size_t size)
BerkeleyBatch::SafeDbt::SafeDbt(void* data, size_t size)
: m_dbt(data, size)
{
}