Remove some dead code
authortb <tb@openbsd.org>
Tue, 4 Jan 2022 20:04:38 +0000 (20:04 +0000)
committertb <tb@openbsd.org>
Tue, 4 Jan 2022 20:04:38 +0000 (20:04 +0000)
IPAddressRange_new() populates both its min and max members, so
they won't ever be NULL and will never need to be allocated.

ok inoguchi jsing

lib/libcrypto/x509/x509_addr.c

index 684a115..a3d5ec7 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: x509_addr.c,v 1.50 2022/01/04 20:02:22 tb Exp $ */
+/*     $OpenBSD: x509_addr.c,v 1.51 2022/01/04 20:04:38 tb Exp $ */
 /*
  * Contributed to the OpenSSL Project by the American Registry for
  * Internet Numbers ("ARIN").
@@ -849,12 +849,6 @@ make_addressRange(IPAddressOrRange **result, unsigned char *min,
        aor->type = IPAddressOrRange_addressRange;
        if ((aor->u.addressRange = IPAddressRange_new()) == NULL)
                goto err;
-       if (aor->u.addressRange->min == NULL &&
-           (aor->u.addressRange->min = ASN1_BIT_STRING_new()) == NULL)
-               goto err;
-       if (aor->u.addressRange->max == NULL &&
-           (aor->u.addressRange->max = ASN1_BIT_STRING_new()) == NULL)
-               goto err;
 
        for (i = length; i > 0 && min[i - 1] == 0x00; --i)
                continue;