From: zhaozg Date: Wed, 18 Aug 2021 07:40:22 +0000 (+0800) Subject: ts: fix memleaks caused by TS_VERIFY_CTX_set_imprint X-Git-Tag: openssl-3.0.0~61 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=62bae84d4587ec9a56d0ce830e36e4a5b2fa8a33;p=thirdparty%2Fopenssl.git 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) --- diff --git a/crypto/ts/ts_verify_ctx.c b/crypto/ts/ts_verify_ctx.c index 74784216897..2f6f00c0ccd 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;