fix possible memory leaks in CWallet::EncryptWallet
- add missing deletes for pwalletdbEncryption - add an assert before trying to reserve memory for pwalletdbEncryption - add a destructor to CWallet, which ensures deletion of pwalletdbEncryption on object destruction
This commit is contained in:
@@ -143,6 +143,7 @@ public:
|
||||
{
|
||||
SetNull();
|
||||
}
|
||||
|
||||
CWallet(std::string strWalletFileIn)
|
||||
{
|
||||
SetNull();
|
||||
@@ -150,6 +151,13 @@ public:
|
||||
strWalletFile = strWalletFileIn;
|
||||
fFileBacked = true;
|
||||
}
|
||||
|
||||
~CWallet()
|
||||
{
|
||||
delete pwalletdbEncryption;
|
||||
pwalletdbEncryption = NULL;
|
||||
}
|
||||
|
||||
void SetNull()
|
||||
{
|
||||
nWalletVersion = FEATURE_BASE;
|
||||
|
||||
Reference in New Issue
Block a user