Free pwalletdbEncryption after encryping wallet
authorPieter Wuille <pieter.wuille@gmail.com>
Sat, 18 Feb 2012 14:36:40 +0000 (15:36 +0100)
committerPieter Wuille <pieter.wuille@gmail.com>
Sat, 18 Feb 2012 14:44:34 +0000 (15:44 +0100)
Fixes a memory leak.

src/wallet.cpp

index 1e769d7..9d80f8a 100644 (file)
@@ -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;
         }