diff options
author | Theo Buehler <tb@cvs.openbsd.org> | 2021-12-28 16:05:24 +0000 |
---|---|---|
committer | Theo Buehler <tb@cvs.openbsd.org> | 2021-12-28 16:05:24 +0000 |
commit | aa40a4a457ed2a36ef7e6130dd67c49dbb5c02d5 (patch) | |
tree | 2f89b45cf7cc23cbb6e95e078846a37959548597 /lib/libcrypto | |
parent | 04bbb1a0cd18c96acb02c5835c6df1a2f9426e5a (diff) |
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 'lib/libcrypto')
-rw-r--r-- | lib/libcrypto/x509/x509_addr.c | 8 |
1 files changed, 1 insertions, 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)) |