diff --git a/crypto/dsa/dsa_gen.c b/crypto/dsa/dsa_gen.c index 97110ef90..056e50049 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);