summaryrefslogtreecommitdiff
path: root/crypto/ts
diff options
context:
space:
mode:
authorzhaozg <zhaozg@gmail.com>2021-08-18 15:40:22 +0800
committerTomas Mraz <tomas@openssl.org>2021-08-26 11:06:06 +0200
commit62bae84d4587ec9a56d0ce830e36e4a5b2fa8a33 (patch)
treeba2ce80cc71a9157c50a996ac5843f233d6bddba /crypto/ts
parenta291cfdfdee0cb40a684e1c379eff88ba43f784b (diff)
downloadopenssl-new-62bae84d4587ec9a56d0ce830e36e4a5b2fa8a33.tar.gz
ts: fix memleaks caused by TS_VERIFY_CTX_set_imprint
CLA: trivial Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16347)
Diffstat (limited to 'crypto/ts')
-rw-r--r--crypto/ts/ts_verify_ctx.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/crypto/ts/ts_verify_ctx.c b/crypto/ts/ts_verify_ctx.c
index 7478421689..2f6f00c0cc 100644
--- a/crypto/ts/ts_verify_ctx.c
+++ b/crypto/ts/ts_verify_ctx.c
@@ -70,6 +70,7 @@ STACK_OF(X509) *TS_VERIFY_CTX_set_certs(TS_VERIFY_CTX *ctx,
unsigned char *TS_VERIFY_CTX_set_imprint(TS_VERIFY_CTX *ctx,
unsigned char *hexstr, long len)
{
+ OPENSSL_free(ctx->imprint);
ctx->imprint = hexstr;
ctx->imprint_len = len;
return ctx->imprint;