Page MenuHomePhabricator

[wallet] Fix leak in CDB constructor
ClosedPublic

Authored by Fabien on Dec 28 2018, 21:59.

Details

Summary

Now using a std::unique_ptr, the Db instance is correctly released
when CDB initialization fails.
The internal CDB state and mapFileUseCount are only mutated when
the CDB initialization succeeds.

Backport of core PR11492
Complete T220

Test Plan
make check

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.