From 8af7858409a3364e2e4a8b8d26eef7e913f6f701 Mon Sep 17 00:00:00 2001 From: tb Date: Tue, 4 Jan 2022 20:02:22 +0000 Subject: [PATCH] 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 --- lib/libcrypto/x509/x509_addr.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/libcrypto/x509/x509_addr.c b/lib/libcrypto/x509/x509_addr.c index 227d934806e..684a115401c 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.49 2022/01/04 19:56:53 tb Exp $ */ +/* $OpenBSD: x509_addr.c,v 1.50 2022/01/04 20:02:22 tb Exp $ */ /* * Contributed to the OpenSSL Project by the American Registry for * Internet Numbers ("ARIN"). @@ -810,8 +810,7 @@ make_addressPrefix(IPAddressOrRange **result, unsigned char *addr, if (aor == NULL) return 0; aor->type = IPAddressOrRange_addressPrefix; - if (aor->u.addressPrefix == NULL && - (aor->u.addressPrefix = ASN1_BIT_STRING_new()) == NULL) + if ((aor->u.addressPrefix = ASN1_BIT_STRING_new()) == NULL) goto err; if (!ASN1_BIT_STRING_set(aor->u.addressPrefix, addr, bytelen)) goto err; -- 2.20.1