aboutsummaryrefslogtreecommitdiff
path: root/src/key.h
diff options
context:
space:
mode:
authorLuke Dashjr <luke-jr+git@utopios.org>2012-03-03 13:59:19 -0500
committerLuke Dashjr <luke-jr+git@utopios.org>2012-03-03 13:59:19 -0500
commit7013cc3d9710c0a03f6587c854e4e50c358ea70c (patch)
tree35e3c2ff533126be6d8d495eb6cf33d62b609014 /src/key.h
parentef48e9b7dfde66368c27ed34f5f42de1b8e781f9 (diff)
parent88aa771536014919e955c4f7b2cada9a0dcf8561 (diff)
Merge branch '0.4.x' into 0.5.0.x
Diffstat (limited to 'src/key.h')
-rw-r--r--src/key.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/key.h b/src/key.h
index 6da0dc288d..f20acb3348 100644
--- a/src/key.h
+++ b/src/key.h
@@ -229,10 +229,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;
return true;