Commit 91dc4497 authored by Pascal Cuoq's avatar Pascal Cuoq Committed by Kurt Roeckx
Browse files

Move BN_CTX_start() call so the error case can always call BN_CTX_end().



Signed-off-by: default avatarKurt Roeckx <kurt@roeckx.be>
Reviewed-by: default avatarRich Salz <rsalz@openssl.org>
MR #1231

(cherry picked from commit 99c20333)
parent 11ca27c9
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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);