summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2021-12-28 16:05:23 +0000
committertb <>2021-12-28 16:05:23 +0000
commitaebd8f6e8a2e74237ea4e3ecf83287e5430484d5 (patch)
tree3dab789e3a1c013d034d8c98a770f33390387f9e
parent4cb6e8841ebb2057eb6551992c46f0a401569801 (diff)
downloadopenbsd-aebd8f6e8a2e74237ea4e3ecf83287e5430484d5.tar.gz
openbsd-aebd8f6e8a2e74237ea4e3ecf83287e5430484d5.tar.bz2
openbsd-aebd8f6e8a2e74237ea4e3ecf83287e5430484d5.zip
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
-rw-r--r--src/lib/libcrypto/x509/x509_addr.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/lib/libcrypto/x509/x509_addr.c b/src/lib/libcrypto/x509/x509_addr.c
index fda73b304e..a0c73bdee5 100644
--- a/src/lib/libcrypto/x509/x509_addr.c
+++ b/src/lib/libcrypto/x509/x509_addr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_addr.c,v 1.30 2021/12/28 15:59:13 tb Exp $ */ 1/* $OpenBSD: x509_addr.c,v 1.31 2021/12/28 16:05:23 tb Exp $ */
2/* 2/*
3 * Contributed to the OpenSSL Project by the American Registry for 3 * Contributed to the OpenSSL Project by the American Registry for
4 * Internet Numbers ("ARIN"). 4 * Internet Numbers ("ARIN").
@@ -787,12 +787,6 @@ make_IPAddressFamily(IPAddrBlocks *addr, const unsigned afi,
787 787
788 if ((f = IPAddressFamily_new()) == NULL) 788 if ((f = IPAddressFamily_new()) == NULL)
789 goto err; 789 goto err;
790 if (f->ipAddressChoice == NULL &&
791 (f->ipAddressChoice = IPAddressChoice_new()) == NULL)
792 goto err;
793 if (f->addressFamily == NULL &&
794 (f->addressFamily = ASN1_OCTET_STRING_new()) == NULL)
795 goto err;
796 if (!ASN1_OCTET_STRING_set(f->addressFamily, key, keylen)) 790 if (!ASN1_OCTET_STRING_set(f->addressFamily, key, keylen))
797 goto err; 791 goto err;
798 if (!sk_IPAddressFamily_push(addr, f)) 792 if (!sk_IPAddressFamily_push(addr, f))