aboutsummaryrefslogtreecommitdiff
path: root/src/wallet.h
diff options
context:
space:
mode:
authorPhilip Kaufmann <[email protected]>2014-09-28 16:11:17 +0200
committerPhilip Kaufmann <[email protected]>2014-10-01 08:48:23 +0200
commit870da77da632501e8eec58ed73e8f30549cc41e9 (patch)
tree405722d8204e9d212c98d08ed49dff99cefc8103 /src/wallet.h
parentfix a possible memory leak in CWalletDB::Recover (diff)
downloaddiscoin-870da77da632501e8eec58ed73e8f30549cc41e9.tar.xz
discoin-870da77da632501e8eec58ed73e8f30549cc41e9.zip
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 fde87a8a2..344f9c0e0 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;