From 91dc4497dec6fcb1e0ecf61f257c9c13364328b4 Mon Sep 17 00:00:00 2001 From: Pascal Cuoq Date: Tue, 5 May 2015 11:20:39 +0200 Subject: 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 (cherry picked from commit 99c203337574d967c86ffbfa13f40ace51048485) --- 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 defa499..0dada3d 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); -- 1.7.12.1