From ad3c4298e6a61862b3f9ffc14707190f55884cbb Mon Sep 17 00:00:00 2001 From: tb Date: Tue, 28 Dec 2021 16:05:23 +0000 Subject: [PATCH] Remove two pointless NULL checks and allocations The ASN.1 template for IPAddressFamily doesn't mark either of its two members as optional, so they are allocated by IPAddressFamily_new(). ok inoguchi jsing --- lib/libcrypto/x509/x509_addr.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/libcrypto/x509/x509_addr.c b/lib/libcrypto/x509/x509_addr.c index fda73b304e1..a0c73bdee58 100644 --- a/lib/libcrypto/x509/x509_addr.c +++ b/lib/libcrypto/x509/x509_addr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_addr.c,v 1.30 2021/12/28 15:59:13 tb Exp $ */ +/* $OpenBSD: x509_addr.c,v 1.31 2021/12/28 16:05:23 tb Exp $ */ /* * Contributed to the OpenSSL Project by the American Registry for * Internet Numbers ("ARIN"). @@ -787,12 +787,6 @@ make_IPAddressFamily(IPAddrBlocks *addr, const unsigned afi, if ((f = IPAddressFamily_new()) == NULL) goto err; - if (f->ipAddressChoice == NULL && - (f->ipAddressChoice = IPAddressChoice_new()) == NULL) - goto err; - if (f->addressFamily == NULL && - (f->addressFamily = ASN1_OCTET_STRING_new()) == NULL) - goto err; if (!ASN1_OCTET_STRING_set(f->addressFamily, key, keylen)) goto err; if (!sk_IPAddressFamily_push(addr, f)) -- 2.20.1