aboutsummaryrefslogtreecommitdiff
path: root/src/wallet.h
diff options
context:
space:
mode:
authorPhilip Kaufmann <phil.kaufmann@t-online.de>2014-09-28 16:11:17 +0200
committerPhilip Kaufmann <phil.kaufmann@t-online.de>2014-10-01 08:48:23 +0200
commit870da77da632501e8eec58ed73e8f30549cc41e9 (patch)
tree405722d8204e9d212c98d08ed49dff99cefc8103 /src/wallet.h
parentf606bb9bafafb12bcf9bc0834125c884da97f9e1 (diff)
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
Diffstat (limited to 'src/wallet.h')
-rw-r--r--src/wallet.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/wallet.h b/src/wallet.h
index fde87a8a2f..344f9c0e04 100644
--- a/src/wallet.h
+++ b/src/wallet.h
@@ -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;