If memory debugging enabled return error on leaks.
[openssl.git] / test / exptest.c
index 170de09c160e986bac25c2416d9426eff3d5a1d0..5cd79e2970b9518daa60fb92b2e960213088d811 100644 (file)
@@ -1,4 +1,3 @@
-/* crypto/bn/exptest.c */
 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
  * All rights reserved.
  *
@@ -67,7 +66,7 @@
 #include <openssl/rand.h>
 #include <openssl/err.h>
 
-#define NUM_BITS        (BN_BITS*2)
+#define NUM_BITS        (BN_BITS2 * 4)
 
 static const char rnd_seed[] =
     "string to make the random number generator think it has entropy";
@@ -300,7 +299,10 @@ int main(int argc, char *argv[])
     BN_free(m);
     BN_CTX_free(ctx);
     ERR_remove_thread_state(NULL);
-    CRYPTO_mem_leaks(out);
+#ifndef OPENSSL_NO_CRYPTO_MDEBUG
+    if (CRYPTO_mem_leaks(out) <= 0)
+        goto err;
+#endif
     BIO_free(out);
     printf("\n");