]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Add a missing call to BIO_closesocket()
authorMatt Caswell <matt@openssl.org>
Wed, 6 Sep 2023 11:14:33 +0000 (12:14 +0100)
committerMatt Caswell <matt@openssl.org>
Fri, 8 Sep 2023 14:44:37 +0000 (15:44 +0100)
A couple of the demos missed a call to this function in an error case.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21950)

demos/guide/quic-client-block.c
demos/guide/quic-client-non-block.c
demos/guide/quic-multi-stream.c
doc/man7/ossl-guide-quic-client-block.pod

index b63012829f1853a837ab0236e858994f39e30e23..2c177b4f187fb04ad7f8203f23f81503cbc0403a 100644 (file)
@@ -66,6 +66,7 @@ static BIO *create_socket_bio(const char *hostname, const char *port,
 
         /* Set to nonblocking mode */
         if (!BIO_socket_nbio(sock, 1)) {
+            BIO_closesocket(sock);
             sock = -1;
             continue;
         }
index be4c9b19676acbea5659177f36e34106ac64c825..e1735c0c5d261bdd5fe16b1d8bdf45c164d8dc96 100644 (file)
@@ -67,6 +67,7 @@ static BIO *create_socket_bio(const char *hostname, const char *port,
 
         /* Set to nonblocking mode */
         if (!BIO_socket_nbio(sock, 1)) {
+            BIO_closesocket(sock);
             sock = -1;
             continue;
         }
index 5b7c8581eb7b9acd09f7c0684e6d528f76da378b..8b6567aa8377610b4c6425f1a330749c800899ef 100644 (file)
@@ -66,6 +66,7 @@ static BIO *create_socket_bio(const char *hostname, const char *port,
 
         /* Set to nonblocking mode */
         if (!BIO_socket_nbio(sock, 1)) {
+            BIO_closesocket(sock);
             sock = -1;
             continue;
         }
index 595135c69668b18c2f780227fd9f110ed0c22e62..4cf8bdd3b828978a3212f2168692a9afd5ba0f9c 100644 (file)
@@ -123,6 +123,7 @@ for TCP).
 
         /* Set to nonblocking mode */
         if (!BIO_socket_nbio(sock, 1)) {
+            BIO_closesocket(sock);
             sock = -1;
             continue;
         }