If x and y are all NULL, then it is unnecessary to do subsequent operations.
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19905)
goto err;
}
if (px != NULL || py != NULL) {
- if (px != NULL)
+ if (px != NULL) {
x = BN_CTX_get(bnctx);
- if (py != NULL)
+ if (x == NULL)
+ goto err;
+ }
+ if (py != NULL) {
y = BN_CTX_get(bnctx);
+ if (y == NULL)
+ goto err;
+ }
if (!EC_POINT_get_affine_coordinates(ecg, pub_point, x, y, bnctx))
goto err;