Note cipher BIO write errors too.
[openssl.git] / test / srptest.c
index f6555a60e128861ea5ed2509bd5e3c1537557398..8d0aaa3bcd05f21c0834c5ad2a4a63d53e57f12a 100644 (file)
@@ -1,3 +1,12 @@
+/*
+ * Copyright 2011-2016 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the OpenSSL license (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
 #include <openssl/opensslconf.h>
 #ifdef OPENSSL_NO_SRP
 
@@ -129,7 +138,6 @@ int main(int argc, char **argv)
     CRYPTO_set_mem_debug(1);
     CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);
 
-    ERR_load_crypto_strings();
 
     /* "Negative" test, expect a mismatch */
     if (run_srp("alice", "password1", "password2") == 0) {
@@ -143,11 +151,9 @@ int main(int argc, char **argv)
         return 1;
     }
 
-    CRYPTO_cleanup_all_ex_data();
-    ERR_remove_thread_state(NULL);
-    ERR_free_strings();
 #ifndef OPENSSL_NO_CRYPTO_MDEBUG
-    CRYPTO_mem_leaks(bio_err);
+    if (CRYPTO_mem_leaks(bio_err) <= 0)
+        return 1;
 #endif
     BIO_free(bio_err);