MCPcopy Create free account
hub / github.com/ElementsProject/elements / ~SafeDbt

Method ~SafeDbt

src/wallet/bdb.cpp:231–243  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

229}
230
231BerkeleyBatch::SafeDbt::~SafeDbt()
232{
233 if (m_dbt.get_data() != nullptr) {
234 // Clear memory, e.g. in case it was a private key
235 memory_cleanse(m_dbt.get_data(), m_dbt.get_size());
236 // under DB_DBT_MALLOC, data is malloced by the Dbt, but must be
237 // freed by the caller.
238 // https://docs.oracle.com/cd/E17275_01/html/api_reference/C/dbt.html
239 if (m_dbt.get_flags() & DB_DBT_MALLOC) {
240 free(m_dbt.get_data());
241 }
242 }
243}
244
245const void* BerkeleyBatch::SafeDbt::get_data() const
246{

Callers

nothing calls this directly

Calls 3

memory_cleanseFunction · 0.85
get_dataMethod · 0.80
get_sizeMethod · 0.80

Tested by

no test coverage detected