mirror of
https://github.com/openssl/openssl.git
synced 2024-11-21 01:15:20 +08:00
ctrl_params_translate: Fix leak of BN_CTX
Also add a missing allocation failure check. Fixes #16788 Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> (Merged from https://github.com/openssl/openssl/pull/16804)
This commit is contained in:
parent
58608487a4
commit
922422119d
@ -1595,10 +1595,13 @@ static int get_payload_public_key(enum state state,
|
||||
const EC_GROUP *ecg = EC_KEY_get0_group(eckey);
|
||||
const EC_POINT *point = EC_KEY_get0_public_key(eckey);
|
||||
|
||||
if (bnctx == NULL)
|
||||
return 0;
|
||||
ctx->sz = EC_POINT_point2buf(ecg, point,
|
||||
POINT_CONVERSION_COMPRESSED,
|
||||
&buf, bnctx);
|
||||
ctx->p2 = buf;
|
||||
BN_CTX_free(bnctx);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user