diff options
author | FdaSilvaYY <fdasilvayy@gmail.com> | 2016-03-18 23:17:39 +0100 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2016-04-06 06:17:21 -0400 |
commit | f0e1fe7cc30b22d9e24ac38f0d4631f9b8042e12 (patch) | |
tree | f5d6d12ca8afae7d8e537c97e7d459be5e599395 /test/ct_test.c | |
parent | 570c0716e30ca3490cc8f5d8d7cf25bcd99d6c7c (diff) |
Add missing mem leak test activation and checks
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'test/ct_test.c')
-rw-r--r-- | test/ct_test.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ct_test.c b/test/ct_test.c index ce417ab9bd..5446f9d0da 100644 --- a/test/ct_test.c +++ b/test/ct_test.c @@ -565,6 +565,11 @@ int main(int argc, char *argv[]) int result = 0; char *tmp_env = NULL; + tmp_env = getenv("OPENSSL_DEBUG_MEMORY"); + if (tmp_env != NULL && strcmp(tmp_env, "on") == 0) + CRYPTO_set_mem_debug(1); + CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON); + tmp_env = getenv("CT_DIR"); ct_dir = OPENSSL_strdup(tmp_env != NULL ? tmp_env : "ct"); tmp_env = getenv("CERTS_DIR"); @@ -584,6 +589,11 @@ int main(int argc, char *argv[]) OPENSSL_free(ct_dir); OPENSSL_free(certs_dir); +#ifndef OPENSSL_NO_CRYPTO_MDEBUG + if (CRYPTO_mem_leaks_fp(stderr) <= 0) + result = 1; +#endif + return result; } |