diff options
author | tb <> | 2022-01-04 20:02:22 +0000 |
---|---|---|
committer | tb <> | 2022-01-04 20:02:22 +0000 |
commit | bc86e943131a268c4b8cad66436ba4ab720c8054 (patch) | |
tree | dc19052bdf8d350a3627d428ca7825ed1709cc15 /src/lib | |
parent | b12b3490ed823138c3caf219523ffd0555a07d88 (diff) | |
download | openbsd-bc86e943131a268c4b8cad66436ba4ab720c8054.tar.gz openbsd-bc86e943131a268c4b8cad66436ba4ab720c8054.tar.bz2 openbsd-bc86e943131a268c4b8cad66436ba4ab720c8054.zip |
Drop a pointless NULL check
IPAddressOrRange_new() instantiates a choice type, so we need to
allocate one member of the union ourselves, so aor->u.addressPrefix
will always be NULL.
ok inoguchi jsing
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/libcrypto/x509/x509_addr.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lib/libcrypto/x509/x509_addr.c b/src/lib/libcrypto/x509/x509_addr.c index 227d934806..684a115401 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.49 2022/01/04 19:56:53 tb Exp $ */ | 1 | /* $OpenBSD: x509_addr.c,v 1.50 2022/01/04 20:02:22 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"). |
@@ -810,8 +810,7 @@ make_addressPrefix(IPAddressOrRange **result, unsigned char *addr, | |||
810 | if (aor == NULL) | 810 | if (aor == NULL) |
811 | return 0; | 811 | return 0; |
812 | aor->type = IPAddressOrRange_addressPrefix; | 812 | aor->type = IPAddressOrRange_addressPrefix; |
813 | if (aor->u.addressPrefix == NULL && | 813 | if ((aor->u.addressPrefix = ASN1_BIT_STRING_new()) == NULL) |
814 | (aor->u.addressPrefix = ASN1_BIT_STRING_new()) == NULL) | ||
815 | goto err; | 814 | goto err; |
816 | if (!ASN1_BIT_STRING_set(aor->u.addressPrefix, addr, bytelen)) | 815 | if (!ASN1_BIT_STRING_set(aor->u.addressPrefix, addr, bytelen)) |
817 | goto err; | 816 | goto err; |