From 870da77da632501e8eec58ed73e8f30549cc41e9 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Sun, 28 Sep 2014 16:11:17 +0200 Subject: 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 --- src/wallet.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/wallet.h') 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; -- cgit v1.2.3