mirror of
https://github.com/openssl/openssl.git
synced 2025-01-30 14:01:55 +08:00
Optimize out unneeded up_ref/free of EVP_CIPHER
Fixes #22189 Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22198)
This commit is contained in:
parent
9f6eb62221
commit
8ed76c62b5
@ -200,7 +200,12 @@ static int evp_cipher_init_internal(EVP_CIPHER_CTX *ctx,
|
||||
#endif
|
||||
}
|
||||
|
||||
if (cipher->prov != NULL) {
|
||||
if (!ossl_assert(cipher->prov != NULL)) {
|
||||
ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (cipher != ctx->fetched_cipher) {
|
||||
if (!EVP_CIPHER_up_ref((EVP_CIPHER *)cipher)) {
|
||||
ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user