From: Niels Dossche Date: Tue, 5 Nov 2024 15:14:40 +0000 (+0100) Subject: Remove unnecessary sk_GENERAL_NAME_free() calls on NULL X-Git-Tag: openssl-3.5.0-alpha1~937 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=83b62d41b2b96a71051a2f46f6e97769b3b0d5da;p=thirdparty%2Fopenssl.git Remove unnecessary sk_GENERAL_NAME_free() calls on NULL There are several calls to sk_GENERAL_NAME_free() where the argument is actually NULL, there are not necessary. Reviewed-by: Kurt Roeckx Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/25877) --- diff --git a/crypto/x509/v3_san.c b/crypto/x509/v3_san.c index 6146062b0dd..dfcebc0a354 100644 --- a/crypto/x509/v3_san.c +++ b/crypto/x509/v3_san.c @@ -308,7 +308,6 @@ static GENERAL_NAMES *v2i_issuer_alt(X509V3_EXT_METHOD *method, if (gens == NULL) { ERR_raise(ERR_LIB_X509V3, ERR_R_CRYPTO_LIB); - sk_GENERAL_NAME_free(gens); return NULL; } for (i = 0; i < num; i++) { @@ -387,7 +386,6 @@ static GENERAL_NAMES *v2i_subject_alt(X509V3_EXT_METHOD *method, gens = sk_GENERAL_NAME_new_reserve(NULL, num); if (gens == NULL) { ERR_raise(ERR_LIB_X509V3, ERR_R_CRYPTO_LIB); - sk_GENERAL_NAME_free(gens); return NULL; } @@ -483,7 +481,6 @@ GENERAL_NAMES *v2i_GENERAL_NAMES(const X509V3_EXT_METHOD *method, gens = sk_GENERAL_NAME_new_reserve(NULL, num); if (gens == NULL) { ERR_raise(ERR_LIB_X509V3, ERR_R_CRYPTO_LIB); - sk_GENERAL_NAME_free(gens); return NULL; }