diff options
| author | Philip Kaufmann <[email protected]> | 2014-09-28 16:11:17 +0200 |
|---|---|---|
| committer | Philip Kaufmann <[email protected]> | 2014-10-01 08:48:23 +0200 |
| commit | 870da77da632501e8eec58ed73e8f30549cc41e9 (patch) | |
| tree | 405722d8204e9d212c98d08ed49dff99cefc8103 /src/wallet.h | |
| parent | fix a possible memory leak in CWalletDB::Recover (diff) | |
| download | discoin-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.h | 8 |
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; |