The branch master has been updated via 4a4c4bf06d6362f56507c787c61b07655563e962 (commit) from 32804b04b8f3c889beebb6e63e14cc3ea4d8273c (commit)
- Log ----------------------------------------------------------------- commit 4a4c4bf06d6362f56507c787c61b07655563e962 Author: Dr. Stephen Henson <st...@openssl.org> Date: Thu Oct 13 16:10:21 2016 +0100 Add memory leak detection to d2i_test Reviewed-by: Rich Salz <rs...@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1707) ----------------------------------------------------------------------- Summary of changes: test/d2i_test.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/d2i_test.c b/test/d2i_test.c index b173cc5..9c6fcb6 100644 --- a/test/d2i_test.c +++ b/test/d2i_test.c @@ -142,6 +142,7 @@ int main(int argc, char **argv) int result = 0; const char *test_type_name; const char *expected_error_string; + const char *p = getenv("OPENSSL_DEBUG_MEMORY"); size_t i; @@ -153,6 +154,10 @@ int main(int argc, char **argv) {"compare", ASN1_COMPARE} }; + if (p != NULL && strcmp(p, "on") == 0) + CRYPTO_set_mem_debug(1); + CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON); + if (argc != 4) { fprintf(stderr, "Usage: d2i_test item_name expected_error file.der\n"); @@ -194,5 +199,10 @@ int main(int argc, char **argv) result = run_tests(argv[0]); +#ifndef OPENSSL_NO_CRYPTO_MDEBUG + if (CRYPTO_mem_leaks_fp(stderr) <= 0) + result = 1; +#endif + return result; } _____ openssl-commits mailing list To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-commits