summaryrefslogtreecommitdiffstats
path: root/test/asynctest.c
diff options
context:
space:
mode:
authorTianjia Zhang <tianjia.zhang@linux.alibaba.com>2021-09-28 23:23:44 +0800
committerHugo Landau <hlandau@openssl.org>2022-09-23 14:30:44 +0100
commit7c05215b872a78c48326bf6d646410bb7d30db40 (patch)
tree964fcd1e1223d6352a02167a9c8f483b2dc41918 /test/asynctest.c
parent3e7ecb8627a585c05de4cfb8420609ae30c1d91a (diff)
test: Fix memory leak of asynctest
ASYNC_init_thread() will be called automatically by ASYNC_start_job(), so ASYNC_cleanup_thread() must be called at last, otherwise it will cause memory leak. Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16703) (cherry picked from commit c5d061290baa9466182b6d1a5b88aa9e5a4b2386)
Diffstat (limited to 'test/asynctest.c')
-rw-r--r--test/asynctest.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/asynctest.c b/test/asynctest.c
index 6502ee9845..628d0d86ea 100644
--- a/test/asynctest.c
+++ b/test/asynctest.c
@@ -409,6 +409,7 @@ static int test_ASYNC_start_job_ex(void)
ret = 1;
err:
ASYNC_WAIT_CTX_free(waitctx);
+ ASYNC_cleanup_thread();
OSSL_LIB_CTX_free(libctx);
return ret;
}