If memory debugging enabled return error on leaks.

Reviewed-by: Rich Salz <rsalz@openssl.org>
This commit is contained in:
Dr. Stephen Henson 2016-01-14 22:00:03 +00:00
parent cc5a9ba485
commit 541e9565bb
17 changed files with 34 additions and 17 deletions

View file

@ -429,7 +429,8 @@ int main(int argc, char *argv[])
BIO_free_all(bio_out);
apps_shutdown();
#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);

View file

@ -217,7 +217,8 @@ int main(int argc, char *argv[])
EVP_cleanup();
CRYPTO_cleanup_all_ex_data();
#ifndef OPENSSL_NO_CRYPTO_MDEBUG
CRYPTO_mem_leaks(err);
if (CRYPTO_mem_leaks(err) <= 0)
testresult = 0;
#endif
BIO_free(err);

View file

@ -526,7 +526,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);

View file

@ -215,7 +215,8 @@ int main(int argc, char **argv)
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)
ret = 0;
#endif
BIO_free(bio_err);
bio_err = NULL;

View file

@ -516,7 +516,8 @@ int main(int argc, char *argv[])
CRYPTO_cleanup_all_ex_data();
ERR_remove_thread_state(NULL);
#ifndef OPENSSL_NO_CRYPTO_MDEBUG
CRYPTO_mem_leaks_fp(stderr);
if (CRYPTO_mem_leaks_fp(stderr) <= 0)
ret = 1;
#endif
EXIT(ret);
}

View file

@ -545,7 +545,8 @@ int main(void)
ERR_remove_thread_state(NULL);
ERR_free_strings();
#ifndef OPENSSL_NO_CRYPTO_MDEBUG
CRYPTO_mem_leaks(out);
if (CRYPTO_mem_leaks(out) <= 0)
ret = 1;
#endif
BIO_free(out);
return ret;

View file

@ -1687,7 +1687,8 @@ int main(int argc, char *argv[])
ERR_free_strings();
ERR_remove_thread_state(NULL);
#ifndef OPENSSL_NO_CRYPTO_MDEBUG
CRYPTO_mem_leaks_fp(stderr);
if (CRYPTO_mem_leaks_fp(stderr) <= 0)
return 1;
#endif
return 0;

View file

@ -249,7 +249,8 @@ int main(int argc, char *argv[])
ERR_free_strings();
ERR_remove_thread_state(NULL);
#ifndef OPENSSL_NO_CRYPTO_MDEBUG
CRYPTO_mem_leaks_fp(stderr);
if (CRYPTO_mem_leaks_fp(stderr) <= 0)
to_return = 1;
#endif
return to_return;
}

View file

@ -467,7 +467,8 @@ int main(void)
ERR_remove_thread_state(NULL);
ERR_free_strings();
#ifndef OPENSSL_NO_CRYPTO_MDEBUG
CRYPTO_mem_leaks_fp(stderr);
if (CRYPTO_mem_leaks_fp(stderr) <= 0)
return 1;
#endif
printf("PASS\n");

View file

@ -617,7 +617,8 @@ int main(int argc, char **argv)
ERR_remove_thread_state(NULL);
ERR_free_strings();
#ifndef OPENSSL_NO_CRYPTO_MDEBUG
CRYPTO_mem_leaks_fp(stderr);
if (CRYPTO_mem_leaks_fp(stderr) <= 0)
return 1;
#endif
if (t.errors)
return 1;

View file

@ -300,7 +300,8 @@ int main(int argc, char *argv[])
BN_CTX_free(ctx);
ERR_remove_thread_state(NULL);
#ifndef OPENSSL_NO_CRYPTO_MDEBUG
CRYPTO_mem_leaks(out);
if (CRYPTO_mem_leaks(out) <= 0)
goto err;
#endif
BIO_free(out);
printf("\n");

View file

@ -179,7 +179,8 @@ int main(int argc, char **argv)
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
return 0;

View file

@ -206,7 +206,8 @@ int main(int argc, char **argv)
ERR_remove_thread_state(NULL);
ERR_free_strings();
#ifndef OPENSSL_NO_CRYPTO_MDEBUG
CRYPTO_mem_leaks_fp(stderr);
if (CRYPTO_mem_leaks_fp(stderr) <= 0)
return 1;
# endif
return 0;
}

View file

@ -328,7 +328,8 @@ int main(int argc, char *argv[])
ERR_remove_thread_state(NULL);
#ifndef OPENSSL_NO_CRYPTO_MDEBUG
CRYPTO_mem_leaks_fp(stderr);
if (CRYPTO_mem_leaks_fp(stderr) <= 0)
err = 1;
#endif
# ifdef OPENSSL_SYS_NETWARE

View file

@ -147,7 +147,8 @@ int main(int argc, char **argv)
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);

View file

@ -1865,7 +1865,8 @@ int main(int argc, char *argv[])
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);

View file

@ -208,7 +208,8 @@ int main(int argc, char **argv)
ERR_remove_thread_state(NULL);
ERR_free_strings();
#ifndef OPENSSL_NO_CRYPTO_MDEBUG
CRYPTO_mem_leaks_fp(stderr);
if (CRYPTO_mem_leaks_fp(stderr) <= 0)
return 1;
#endif
printf("PASS\n");