We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 29ab96d commit b45c597Copy full SHA for b45c597
src/wallet/db.cpp
@@ -522,7 +522,7 @@ bool CDB::Rewrite(CWalletDBWrapper& dbw, const char* pszSkip)
522
std::string strFileRes = strFile + ".rewrite";
523
{ // surround usage of db with extra {}
524
CDB db(dbw, "r");
525
- Db* pdbCopy = new Db(env->dbenv.get(), 0);
+ std::unique_ptr<Db> pdbCopy = std::unique_ptr<Db>(new Db(env->dbenv.get(), 0));
526
527
int ret = pdbCopy->open(nullptr, // Txn pointer
528
strFileRes.c_str(), // Filename
@@ -571,7 +571,6 @@ bool CDB::Rewrite(CWalletDBWrapper& dbw, const char* pszSkip)
571
} else {
572
pdbCopy->close(0);
573
}
574
- delete pdbCopy;
575
576
if (fSuccess) {
577
Db dbA(env->dbenv.get(), 0);
0 commit comments