mirror of
https://github.com/twisterarmy/twister-core.git
synced 2025-01-11 15:27:57 +00:00
Fix #650: CKey::SetSecret BIGNUM leak
This commit is contained in:
parent
e0b8d459b1
commit
a09f101f14
@ -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…
Reference in New Issue
Block a user