Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Commit 5cd259ca authored by Hongbo Li's avatar Hongbo Li Committed by Herbert Xu
Browse files

crypto: sm2 - fix a memory leak in sm2

SM2 module alloc ec->Q in sm2_set_pub_key(), when doing alg test in
test_akcipher_one(), it will set public key for every test vector,
and don't free ec->Q. This will cause a memory leak.

This patch alloc ec->Q in sm2_ec_ctx_init().

Fixes: ea7ecb66

 ("crypto: sm2 - introduce OSCCA SM2 asymmetric cipher algorithm")
Signed-off-by: default avatarHongbo Li <herberthbli@tencent.com>
Reviewed-by: default avatarTianjia Zhang <tianjia.zhang@linux.alibaba.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 9039878a
Branches
Tags
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment