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
Branch
PR11492
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 4374
Build 6813: Bitcoin ABC Buildbot (legacy)
Build 6812: arc lint + arc unit