summaryrefslogtreecommitdiffstats
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 20:41:34 +0200
commit91dc4497dec6fcb1e0ecf61f257c9c13364328b4 (patch)
tree77e9c928ecea1dadcc72a9a44b8289dd38b73ac4
parent11ca27c912888460a7a06b9308fd85170e1db194 (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 (cherry picked from commit 99c203337574d967c86ffbfa13f40ace51048485)
-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 defa4994b6..0dada3d25e 100644
--- a/crypto/dsa/dsa_gen.c
+++ b/crypto/dsa/dsa_gen.c
@@ -177,10 +177,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);