Commit c5ba2d99 authored by Rich Salz's avatar Rich Salz
Browse files

free NULL cleanup



EVP_.*free; this gets:
        EVP_CIPHER_CTX_free EVP_PKEY_CTX_free EVP_PKEY_asn1_free
        EVP_PKEY_asn1_set_free EVP_PKEY_free EVP_PKEY_free_it
        EVP_PKEY_meth_free; and also EVP_CIPHER_CTX_cleanup

Reviewed-by: default avatarKurt Roeckx <kurt@openssl.org>
parent 33b188a8
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -384,7 +384,6 @@ int MAIN(int argc, char **argv)
        }
        r = 1;
 mac_end:
        if (mac_ctx)
        EVP_PKEY_CTX_free(mac_ctx);
        if (r == 0)
            goto end;
+5 −10
Original line number Diff line number Diff line
@@ -268,9 +268,7 @@ int MAIN(int argc, char **argv)
    ret = 0;

 end:
    if (pkey)
    EVP_PKEY_free(pkey);
    if (ctx)
    EVP_PKEY_CTX_free(ctx);
    BIO_free_all(out);
    BIO_free(in);
@@ -317,9 +315,7 @@ static int init_keygen_file(BIO *err, EVP_PKEY_CTX **pctx,
 err:
    BIO_puts(err, "Error initializing context\n");
    ERR_print_errors(err);
    if (ctx)
    EVP_PKEY_CTX_free(ctx);
    if (pkey)
    EVP_PKEY_free(pkey);
    return 0;

@@ -375,7 +371,6 @@ int init_gen_str(BIO *err, EVP_PKEY_CTX **pctx,
 err:
    BIO_printf(err, "Error initializing %s context\n", algname);
    ERR_print_errors(err);
    if (ctx)
    EVP_PKEY_CTX_free(ctx);
    return 0;

+1 −2
Original line number Diff line number Diff line
@@ -672,7 +672,6 @@ int MAIN(int argc, char **argv)
        CRYPTO_push_info("process -export_cert: freeing");
# endif

        if (key)
        EVP_PKEY_free(key);
        if (certs)
            sk_X509_pop_free(certs, X509_free);
+1 −2
Original line number Diff line number Diff line
@@ -332,7 +332,6 @@ int MAIN(int argc, char **argv)
        BIO_write(out, buf_out, buf_outlen);

 end:
    if (ctx)
    EVP_PKEY_CTX_free(ctx);
    BIO_free(in);
    BIO_free_all(out);
+2 −3
Original line number Diff line number Diff line
@@ -874,9 +874,9 @@ int MAIN(int argc, char **argv)

        if (pkey == NULL) {
            pkey = X509_REQ_get_pubkey(req);
            tmp = 1;
            if (pkey == NULL)
                goto end;
            tmp = 1;
        }

        i = X509_REQ_verify(req, pkey);
@@ -1013,7 +1013,6 @@ int MAIN(int argc, char **argv)
    BIO_free(in);
    BIO_free_all(out);
    EVP_PKEY_free(pkey);
    if (genctx)
    EVP_PKEY_CTX_free(genctx);
    if (pkeyopts)
        sk_OPENSSL_STRING_free(pkeyopts);
Loading