diff options
author | FdaSilvaYY <fdasilvayy@gmail.com> | 2018-03-28 22:32:31 +0200 |
---|---|---|
committer | Dr. Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> | 2018-04-24 09:08:33 +0200 |
commit | 7fcdbd839c629f5419a49bf8da28c968c8140c3d (patch) | |
tree | 85e3b2f53438b4b53a8c94081f8283d78d8c2c93 /crypto/x509/x_crl.c | |
parent | d8f436f3cf771d519573460b14ece6ed01a157ff (diff) |
X509: add more error codes on malloc or sk_TYP_push failure
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/5837)
Diffstat (limited to 'crypto/x509/x_crl.c')
-rw-r--r-- | crypto/x509/x_crl.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/crypto/x509/x_crl.c b/crypto/x509/x_crl.c index dbed850b37..5098b5f23f 100644 --- a/crypto/x509/x_crl.c +++ b/crypto/x509/x_crl.c @@ -309,6 +309,7 @@ static int X509_REVOKED_cmp(const X509_REVOKED *const *a, int X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev) { X509_CRL_INFO *inf; + inf = &crl->crl; if (inf->revoked == NULL) inf->revoked = sk_X509_REVOKED_new(X509_REVOKED_cmp); @@ -429,10 +430,12 @@ X509_CRL_METHOD *X509_CRL_METHOD_new(int (*crl_init) (X509_CRL *crl), int (*crl_verify) (X509_CRL *crl, EVP_PKEY *pk)) { - X509_CRL_METHOD *m; - m = OPENSSL_malloc(sizeof(*m)); - if (m == NULL) + X509_CRL_METHOD *m = OPENSSL_malloc(sizeof(*m)); + + if (m == NULL) { + X509err(X509_F_X509_CRL_METHOD_NEW, ERR_R_MALLOC_FAILURE); return NULL; + } m->crl_init = crl_init; m->crl_free = crl_free; m->crl_lookup = crl_lookup; |