From 62bae84d4587ec9a56d0ce830e36e4a5b2fa8a33 Mon Sep 17 00:00:00 2001 From: zhaozg Date: Wed, 18 Aug 2021 15:40:22 +0800 Subject: [PATCH] ts: fix memleaks caused by TS_VERIFY_CTX_set_imprint CLA: trivial Reviewed-by: Paul Dale Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/16347) --- crypto/ts/ts_verify_ctx.c | 1 + 1 file changed, 1 insertion(+) 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; -- 2.34.1