Fix BIO_new_ssl_connect() to not leak memory

CLA: trivial

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14719)

(cherry picked from commit 7947a1eb13)
This commit is contained in:
Nan Xiao 2021-03-29 12:24:08 +08:00 committed by Tomas Mraz
parent 122e5f7c01
commit fd988967bb
1 changed files with 1 additions and 0 deletions

View File

@ -451,6 +451,7 @@ BIO *BIO_new_ssl_connect(SSL_CTX *ctx)
goto err;
return ret;
err:
BIO_free(ssl);
BIO_free(con);
#endif
return NULL;