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.

Event Timeline

Fabien created this revision.Dec 28 2018, 21:59
Herald added a reviewer: Restricted Project. · View Herald TranscriptDec 28 2018, 21:59
Herald added a subscriber: schancel. · View Herald Transcript
jasonbcox accepted this revision.Dec 28 2018, 22:18
This revision is now accepted and ready to land.Dec 28 2018, 22:18
This revision was automatically updated to reflect the committed changes.