mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-27 11:43:26 -03:00
Fix #650: CKey::SetSecret BIGNUM leak
This commit is contained in:
parent
e0b8d459b1
commit
a09f101f14
1 changed files with 4 additions and 1 deletions
|
@ -144,7 +144,10 @@ public:
|
||||||
if (bn == NULL)
|
if (bn == NULL)
|
||||||
throw key_error("CKey::SetSecret() : BN_bin2bn failed");
|
throw key_error("CKey::SetSecret() : BN_bin2bn failed");
|
||||||
if (!EC_KEY_regenerate_key(pkey,bn))
|
if (!EC_KEY_regenerate_key(pkey,bn))
|
||||||
|
{
|
||||||
|
BN_clear_free(bn);
|
||||||
throw key_error("CKey::SetSecret() : EC_KEY_regenerate_key failed");
|
throw key_error("CKey::SetSecret() : EC_KEY_regenerate_key failed");
|
||||||
|
}
|
||||||
BN_clear_free(bn);
|
BN_clear_free(bn);
|
||||||
fSet = true;
|
fSet = true;
|
||||||
if (fCompressed || fCompressedPubKey)
|
if (fCompressed || fCompressedPubKey)
|
||||||
|
|
Loading…
Add table
Reference in a new issue