]> git.ipfire.org Git - thirdparty/openssl.git/commit
Fix a possible memory leak in SM2 provider
authorHuiyue Xu <xuhuiyue@huawei.com>
Wed, 22 Nov 2023 01:55:27 +0000 (09:55 +0800)
committerHugo Landau <hlandau@openssl.org>
Thu, 23 Nov 2023 15:08:21 +0000 (15:08 +0000)
commite7d34d7ae32f16abbd79a49072cff580bee32269
treebaf688ea113e3fd92484f5b3cab5e2554194d697
parent7fa47fe5b98a5b85963c352fadf188043aae6657
Fix a possible memory leak in SM2 provider

ctx->propq that strdup from input parameter propq in sm2sig_newctx,
is not released. It should be released in sm2sig_freectx and copied
to dstctx in sm2sig_dupctx. And dstctx->id and dstctx->propq should
be set NULL to avoid releasing id/propq of srcctx when err occurs.

Signed-off-by: Huiyue Xu <xuhuiyue@huawei.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Yang <kaishen.yy@antfin.com>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22796)
providers/implementations/signature/sm2_sig.c