Commit 23a1d5e9 authored by Rich Salz's avatar Rich Salz
Browse files

free NULL cleanup 7



This gets BN_.*free:
    BN_BLINDING_free BN_CTX_free BN_FLG_FREE BN_GENCB_free
    BN_MONT_CTX_free BN_RECP_CTX_free BN_clear_free BN_free BUF_MEM_free

Also fix a call to DSA_SIG_free to ccgost engine and remove some #ifdef'd
dead code in engines/e_ubsec.

Reviewed-by: default avatarRichard Levitte <levitte@openssl.org>
parent 34166d41
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1532,6 +1532,7 @@ int rand_serial(BIGNUM *b, ASN1_INTEGER *ai)
{
    BIGNUM *btmp;
    int ret = 0;

    if (b)
        btmp = b;
    else
@@ -1549,7 +1550,7 @@ int rand_serial(BIGNUM *b, ASN1_INTEGER *ai)

 error:

    if (!b)
    if (btmp != b)
        BN_free(btmp);

    return ret;
+2 −4
Original line number Diff line number Diff line
@@ -1289,10 +1289,8 @@ end_of_options:
            if (!save_serial(crlnumberfile, "new", crlnumber, NULL))
                goto end;

        if (crlnumber) {
        BN_free(crlnumber);
        crlnumber = NULL;
        }

        if (!do_X509_CRL_sign(crl, pkey, dgst, sigopts))
            goto end;
+1 −2
Original line number Diff line number Diff line
@@ -328,7 +328,6 @@ int dsaparam_main(int argc, char **argv)
        app_RAND_write_file(NULL);
    ret = 0;
 end:
    if (cb != NULL)
    BN_GENCB_free(cb);
    BIO_free(in);
    BIO_free_all(out);
+6 −12
Original line number Diff line number Diff line
@@ -483,17 +483,11 @@ int ecparam_main(int argc, char **argv)

    ret = 0;
 end:
    if (ec_p)
    BN_free(ec_p);
    if (ec_a)
    BN_free(ec_a);
    if (ec_b)
    BN_free(ec_b);
    if (ec_gen)
    BN_free(ec_gen);
    if (ec_order)
    BN_free(ec_order);
    if (ec_cofactor)
    BN_free(ec_cofactor);
    if (buffer)
        OPENSSL_free(buffer);
+2 −4
Original line number Diff line number Diff line
@@ -214,9 +214,7 @@ int genrsa_main(int argc, char **argv)

    ret = 0;
 end:
    if (bn)
    BN_free(bn);
    if (cb)
    BN_GENCB_free(cb);
    RSA_free(rsa);
    BIO_free_all(out);
Loading