Skip to content

Commit

Permalink
test: Fix memory leak of asynctest
Browse files Browse the repository at this point in the history
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 #16703)

(cherry picked from commit c5d0612)
  • Loading branch information
uudiin authored and hlandau committed Sep 23, 2022
1 parent 3e7ecb8 commit 7c05215
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions test/asynctest.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 7c05215

Please sign in to comment.