Free pwalletdbEncryption after encryping wallet
authorPieter Wuille <pieter.wuille@gmail.com>
Sat, 18 Feb 2012 14:36:40 +0000 (15:36 +0100)
committerLuke Dashjr <luke-jr+git@utopios.org>
Mon, 27 Feb 2012 17:36:56 +0000 (12:36 -0500)
Fixes a memory leak.

src/wallet.cpp

index 43fb6b6..9f7422d 100644 (file)
@@ -183,7 +183,7 @@ bool CWallet::EncryptWallet(const string& 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;
         }