diff options
-rw-r--r-- | src/bignum.h | 2 | ||||
-rw-r--r-- | src/key.h | 5 | ||||
-rw-r--r-- | src/qt/bitcoingui.cpp | 2 | ||||
-rw-r--r-- | src/serialize.h | 1 | ||||
-rw-r--r-- | src/wallet.cpp | 2 |
5 files changed, 9 insertions, 3 deletions
diff --git a/src/bignum.h b/src/bignum.h index 4143f6003d..a750025f3d 100644 --- a/src/bignum.h +++ b/src/bignum.h @@ -243,7 +243,7 @@ public: std::vector<unsigned char> getvch() const { unsigned int nSize = BN_bn2mpi(this, NULL); - if (nSize < 4) + if (nSize <= 4) return std::vector<unsigned char>(); std::vector<unsigned char> vch(nSize); BN_bn2mpi(this, &vch[0]); @@ -141,10 +141,13 @@ public: if (vchSecret.size() != 32) throw key_error("CKey::SetSecret() : secret must be 32 bytes"); BIGNUM *bn = BN_bin2bn(&vchSecret[0],32,BN_new()); - if (bn == NULL) + if (bn == NULL) throw key_error("CKey::SetSecret() : BN_bin2bn failed"); if (!EC_KEY_regenerate_key(pkey,bn)) + { + BN_clear_free(bn); throw key_error("CKey::SetSecret() : EC_KEY_regenerate_key failed"); + } BN_clear_free(bn); fSet = true; if (fCompressed || fCompressedPubKey) diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index c95afdcef3..65753a1839 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -165,6 +165,8 @@ BitcoinGUI::BitcoinGUI(QWidget *parent): BitcoinGUI::~BitcoinGUI() { + if(trayIcon) // Hide tray icon, as deleting will let it linger until quit (on Ubuntu) + trayIcon->hide(); #ifdef Q_WS_MAC delete appMenuBar; #endif diff --git a/src/serialize.h b/src/serialize.h index 6eb4f4ee41..c046bf37ef 100644 --- a/src/serialize.h +++ b/src/serialize.h @@ -23,6 +23,7 @@ typedef long long int64; typedef unsigned long long uint64; #ifdef WIN32 +#define _WIN32_WINNT 0x0501 #include <windows.h> // This is used to attempt to keep keying material out of swap // Note that VirtualLock does not provide this as a guarantee on Windows, diff --git a/src/wallet.cpp b/src/wallet.cpp index 8a33041a1c..30590c80e6 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -235,7 +235,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; } |