summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorPascal Cuoq <cuoq@trust-in-soft.com>2015-05-05 11:20:39 +0200
committerKurt Roeckx <kurt@roeckx.be>2015-10-07 18:54:13 +0200
commit99c203337574d967c86ffbfa13f40ace51048485 (patch)
tree876d0ca7536109a8e08328478c97d48f1a1fabe9 /crypto
parentd6e92c0bd6c36fc68291e79ef5753fd7f0420695 (diff)
Move BN_CTX_start() call so the error case can always call BN_CTX_end().
Signed-off-by: Kurt Roeckx <kurt@roeckx.be> Reviewed-by: Rich Salz <rsalz@openssl.org> MR #1231
Diffstat (limited to 'crypto')
-rw-r--r--crypto/dsa/dsa_gen.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/dsa/dsa_gen.c b/crypto/dsa/dsa_gen.c
index 97110ef90b..056e50049d 100644
--- a/crypto/dsa/dsa_gen.c
+++ b/crypto/dsa/dsa_gen.c
@@ -145,10 +145,11 @@ int dsa_builtin_paramgen(DSA *ret, size_t bits, size_t qbits,
if ((ctx = BN_CTX_new()) == NULL)
goto err;
+ BN_CTX_start(ctx);
+
if ((mont = BN_MONT_CTX_new()) == NULL)
goto err;
- BN_CTX_start(ctx);
r0 = BN_CTX_get(ctx);
g = BN_CTX_get(ctx);
W = BN_CTX_get(ctx);