[wallet] Fix leak in CDB constructor
commit7104de8b1f3a31d3a60009b5dc376adbedac6a9c
authorJoão Barbosa <joao.paulo.barbosa@gmail.com>
Thu, 12 Oct 2017 22:14:46 +0000 (12 23:14 +0100)
committerJoão Barbosa <joao.paulo.barbosa@gmail.com>
Sat, 14 Oct 2017 22:59:46 +0000 (14 23:59 +0100)
tree827a41ec17d3d3e887f236848f122fcf3cdb7832
parent326a5652e0d25fdb60c337ef4f1c98a63e0748f0
[wallet] Fix leak in CDB constructor

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.
src/wallet/db.cpp