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

free NULL cleanup 9



Ongoing work to skip NULL check before calling free routine.  This gets:
    ecp_nistz256_pre_comp_free nistp224_pre_comp_free nistp256_pre_comp_free
    nistp521_pre_comp_free PKCS7_free PKCS7_RECIP_INFO_free
    PKCS7_SIGNER_INFO_free sk_PKCS7_pop_free PKCS8_PRIV_KEY_INFO_free
    PKCS12_free PKCS12_SAFEBAG_free PKCS12_free sk_PKCS12_SAFEBAG_pop_free
    SSL_CONF_CTX_free SSL_CTX_free SSL_SESSION_free SSL_free ssl_cert_free
    ssl_sess_cert_free

Reviewed-by: default avatarKurt Roeckx <kurt@openssl.org>
parent a3853772
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -786,7 +786,6 @@ static int load_pkcs12(BIO *err, BIO *in, const char *desc,
    }
    ret = PKCS12_parse(p12, pass, pkey, cert, ca);
 die:
    if (p12)
    PKCS12_free(p12);
    return ret;
}
+1 −2
Original line number Diff line number Diff line
@@ -270,7 +270,6 @@ int MAIN(int argc, char **argv)
 end:
    BIO_free(in);
    BIO_free_all(out);
    if (p7 != NULL)
    PKCS7_free(p7);
    if (crl != NULL)
        X509_CRL_free(crl);
+2 −5
Original line number Diff line number Diff line
@@ -740,7 +740,6 @@ int MAIN(int argc, char **argv)
# endif
    ret = 0;
 end:
    if (p12)
    PKCS12_free(p12);
    if (export_cert || inrand)
        app_RAND_write_file(NULL, bio_err);
@@ -798,8 +797,6 @@ int dump_certs_keys_p12(BIO *out, PKCS12 *p12, char *pass,
    ret = 1;

 err:

    if (asafes)
    sk_PKCS7_pop_free(asafes, PKCS7_free);
    return ret;
}
+1 −2
Original line number Diff line number Diff line
@@ -297,7 +297,6 @@ int MAIN(int argc, char **argv)
    }
    ret = 0;
 end:
    if (p7 != NULL)
    PKCS7_free(p7);
    BIO_free(in);
    BIO_free_all(out);
+1 −2
Original line number Diff line number Diff line
@@ -1741,7 +1741,6 @@ int ec_GFp_nistp224_precompute_mult(EC_GROUP *group, BN_CTX *ctx)
    EC_POINT_free(generator);
    if (new_ctx != NULL)
        BN_CTX_free(new_ctx);
    if (pre)
    nistp224_pre_comp_free(pre);
    return ret;
}
Loading