From 8726ca64b6aa77a34de9e80aea57dd14151a1dc7 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 9d3b59e..6bc86dd 100644 --- a/crypto/dsa/dsa_gen.c +++ b/crypto/dsa/dsa_gen.c @@ -179,10 +179,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