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_1_0-pre1~454 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=99c203337574d967c86ffbfa13f40ace51048485;p=openssl 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 --- 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);