Fix TLSProxy end of test detection
[openssl.git] / test / dhtest.c
index 35bd298a870bcd0f89bfc6d5269e2471c87bce9c..7e46166eeba9c11326fc16115aad3fcbadce8b0e 100644 (file)
@@ -195,14 +195,11 @@ int main(int argc, char *argv[])
  err:
     ERR_print_errors_fp(stderr);
 
-    if (abuf != NULL)
-        OPENSSL_free(abuf);
-    if (bbuf != NULL)
-        OPENSSL_free(bbuf);
+    OPENSSL_free(abuf);
+    OPENSSL_free(bbuf);
     DH_free(b);
     DH_free(a);
-    if (_cb)
-        BN_GENCB_free(_cb);
+    BN_GENCB_free(_cb);
     BIO_free(out);
 # ifdef OPENSSL_SYS_NETWARE
     if (ret)
@@ -488,7 +485,7 @@ static const rfc5114_td rfctd[] = {
 static int run_rfc5114_tests(void)
 {
     int i;
-    for (i = 0; i < (int)(sizeof(rfctd) / sizeof(rfc5114_td)); i++) {
+    for (i = 0; i < (int)OSSL_NELEM(rfctd); i++) {
         DH *dhA, *dhB;
         unsigned char *Z1 = NULL, *Z2 = NULL;
         const rfc5114_td *td = rfctd + i;