From: Tomas Mraz Date: Thu, 18 Jul 2024 08:11:05 +0000 (+0200) Subject: CMS_get1_crls(): Remove redundant check for NULL crls X-Git-Tag: openssl-3.4.0-alpha1~255 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=96b59ec4b61e10b1b2eb705a4f8f06ea5f976d08;p=thirdparty%2Fopenssl.git CMS_get1_crls(): Remove redundant check for NULL crls Fixes Coverity 1610380 Reviewed-by: Tom Cosgrove Reviewed-by: Neil Horman Reviewed-by: Dmitry Belyavskiy (Merged from https://github.com/openssl/openssl/pull/24928) --- diff --git a/crypto/cms/cms_lib.c b/crypto/cms/cms_lib.c index b09985ad3e2..e6a41a1df0d 100644 --- a/crypto/cms/cms_lib.c +++ b/crypto/cms/cms_lib.c @@ -665,10 +665,6 @@ STACK_OF(X509_CRL) *CMS_get1_crls(CMS_ContentInfo *cms) for (i = 0; i < n; i++) { rch = sk_CMS_RevocationInfoChoice_value(*pcrls, i); if (rch->type == 0) { - if (crls == NULL) { - if ((crls = sk_X509_CRL_new_null()) == NULL) - return NULL; - } if (!sk_X509_CRL_push(crls, rch->d.crl) || !X509_CRL_up_ref(rch->d.crl)) { sk_X509_CRL_pop_free(crls, X509_CRL_free);