X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fkey.h;h=4058f115fdd461a2a36db4909e7c1ba8e4e55576;hb=3a4d81724e873f967b74759d539e05c73f95aeeb;hp=43c8d84520eadeb97ce536cf61ee422276c009a9;hpb=38067c18f8b54c7121643fa3291ffe81b6eefef1;p=novacoin.git diff --git a/src/key.h b/src/key.h index 43c8d84..4058f11 100644 --- a/src/key.h +++ b/src/key.h @@ -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)