mirror of
https://github.com/openssl/openssl.git
synced 2025-02-23 14:42:15 +08:00
OSSL_CMP_MSG_read(): Fix mem leak on file read error
Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17225)
This commit is contained in:
parent
f5485b97b6
commit
d580c2790f
@ -1100,9 +1100,8 @@ OSSL_CMP_MSG *OSSL_CMP_MSG_read(const char *file, OSSL_LIB_CTX *libctx,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if ((bio = BIO_new_file(file, "rb")) == NULL)
|
||||
return NULL;
|
||||
if (d2i_OSSL_CMP_MSG_bio(bio, &msg) == NULL) {
|
||||
if ((bio = BIO_new_file(file, "rb")) == NULL
|
||||
|| d2i_OSSL_CMP_MSG_bio(bio, &msg) == NULL) {
|
||||
OSSL_CMP_MSG_free(msg);
|
||||
msg = NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user