From 99c203337574d967c86ffbfa13f40ace51048485 Mon Sep 17 00:00:00 2001 From: Pascal Cuoq Date: Tue, 5 May 2015 11:20:39 +0200 Subject: [PATCH] Move BN_CTX_start() call so the error case can always call BN_CTX_end(). Signed-off-by: Kurt Roeckx Reviewed-by: Rich Salz MR #1231 --- crypto/dsa/dsa_gen.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); -- 2.34.1