summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2021-12-28 16:05:23 +0000
committertb <>2021-12-28 16:05:23 +0000
commit12217f620d74ebc9b8e9a65060dde7c07cf9726c (patch)
tree3dab789e3a1c013d034d8c98a770f33390387f9e /src
parent77605a5406d4a8081d34a468e122e41a06870c06 (diff)
downloadopenbsd-12217f620d74ebc9b8e9a65060dde7c07cf9726c.tar.gz
openbsd-12217f620d74ebc9b8e9a65060dde7c07cf9726c.tar.bz2
openbsd-12217f620d74ebc9b8e9a65060dde7c07cf9726c.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
Diffstat (limited to 'src')
-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))