From fcfd7ff8f894f0ee3c962a9e469b20d42cbfe5b0 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sat, 18 Feb 2012 15:36:40 +0100 Subject: [PATCH] Free pwalletdbEncryption after encryping wallet Fixes a memory leak. --- src/wallet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wallet.cpp b/src/wallet.cpp index 1e769d7e61..9d80f8afef 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -191,7 +191,7 @@ bool CWallet::EncryptWallet(const SecureString& strWalletPassphrase) if (!pwalletdbEncryption->TxnCommit()) exit(1); //We now have keys encrypted in memory, but no on disk...die to avoid confusion and let the user reload their unencrypted wallet. - pwalletdbEncryption->Close(); + delete pwalletdbEncryption; pwalletdbEncryption = NULL; }