summaryrefslogtreecommitdiffstats
path: root/crypto
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:43 +0200
commit15d1ddde5de9d28b671d3f6fe8757f4b87e67821 (patch)
treeb2bbb64b1405697c183370bd22ec71ed917f8997 /crypto
parent5d91c74fa3fcd8c17184ab8f51745de8354f7362 (diff)
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) (cherry picked from commit 62bae84d4587ec9a56d0ce830e36e4a5b2fa8a33)
Diffstat (limited to 'crypto')
-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 32cd2f542b..b504649a41 100644
--- a/crypto/ts/ts_verify_ctx.c
+++ b/crypto/ts/ts_verify_ctx.c
@@ -70,6 +70,7 @@ STACK_OF(X509) *TS_VERIFY_CTS_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;