From: Pascal Cuoq Date: Tue, 5 May 2015 09:20:39 +0000 (+0200) Subject: Move BN_CTX_start() call so the error case can always call BN_CTX_end(). X-Git-Tag: OpenSSL_1_0_1q~42 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=91dc4497dec6fcb1e0ecf61f257c9c13364328b4;p=oweals%2Fopenssl.git 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) --- 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);