Use File::Path::mkpath rather than File::Path::make_path
[openssl.git] / test / danetest.c
index 09156a6991b4853ce9835a175ca9d8db83391051..cad751f4babf51e438f7f0ccacb37207e1f02567 100644 (file)
@@ -1,4 +1,3 @@
-/* danetest.c */
 /* ====================================================================
  * Copyright (c) 2015 The OpenSSL Project.  All rights reserved.
  *
@@ -472,9 +471,12 @@ int main(int argc, char *argv[])
     CAfile = argv[2];
     tlsafile = argv[3];
 
+    bio_err = BIO_new_fp(stderr, BIO_NOCLOSE | BIO_FP_TEXT);
+
     p = getenv("OPENSSL_DEBUG_MEMORY");
     if (p != NULL && strcmp(p, "on") == 0)
         CRYPTO_set_mem_debug(1);
+    CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);
 
     f = fopen(tlsafile, "r");
     if (f == NULL) {
@@ -483,8 +485,6 @@ int main(int argc, char *argv[])
         return 0;
     }
 
-    bio_err = BIO_new_fp(stderr, BIO_NOCLOSE | BIO_FP_TEXT);
-
     SSL_library_init();
     SSL_load_error_strings();
 
@@ -527,7 +527,8 @@ end:
     ERR_remove_thread_state(NULL);
     EVP_cleanup();
 #ifndef OPENSSL_NO_CRYPTO_MDEBUG
-    CRYPTO_mem_leaks(bio_err);
+    if (CRYPTO_mem_leaks(bio_err) <= 0)
+        ret = 1;
 #endif
     BIO_free(bio_err);
     EXIT(ret);