From 96b59ec4b61e10b1b2eb705a4f8f06ea5f976d08 Mon Sep 17 00:00:00 2001 From: Tomas Mraz Date: Thu, 18 Jul 2024 10:11:05 +0200 Subject: [PATCH] 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) --- crypto/cms/cms_lib.c | 4 ---- 1 file changed, 4 deletions(-) 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); -- 2.47.3