test: coverity 1469426 - dereference after null check

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14589)
This commit is contained in:
Pauli 2021-03-17 13:09:06 +10:00
parent 88ce406c89
commit f1619160c8

View File

@ -8297,7 +8297,7 @@ static EVP_PKEY *get_tmp_dh_params(void)
OSSL_PARAM_BLD_free_params(params);
}
if (!EVP_PKEY_up_ref(tmp_dh_params))
if (tmp_dh_params != NULL && !EVP_PKEY_up_ref(tmp_dh_params))
return NULL;
return tmp_dh_params;