OSSL_HTTP_open(): Fix memory leak on TLS connect failure via proxy

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16119)
This commit is contained in:
Dr. David von Oheimb 2021-07-20 11:19:39 +02:00 committed by Dr. David von Oheimb
parent c74188e86c
commit 981a5b7ce3

View File

@ -926,7 +926,8 @@ OSSL_HTTP_REQ_CTX *OSSL_HTTP_open(const char *server, const char *port,
cbio = (*bio_update_fn)(cbio, arg, 1 /* connect */, use_ssl);
if (cbio == NULL) {
cbio = orig_bio;
if (bio == NULL) /* cbio was not provided by caller */
BIO_free_all(orig_bio);
goto end;
}
}