summaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2023-09-06 12:14:33 +0100
committerMatt Caswell <matt@openssl.org>2023-09-08 15:44:37 +0100
commitcdedecd50351a3624b074e6a425d8dfb3af5fa6a (patch)
treeb65505c9a8655276b749c9ac46e953a8568499ff /demos
parent38c3c1dbefa8b8333e78e0d9d38fac7c4359f826 (diff)
Add a missing call to BIO_closesocket()
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)
Diffstat (limited to 'demos')
-rw-r--r--demos/guide/quic-client-block.c1
-rw-r--r--demos/guide/quic-client-non-block.c1
-rw-r--r--demos/guide/quic-multi-stream.c1
3 files changed, 3 insertions, 0 deletions
diff --git a/demos/guide/quic-client-block.c b/demos/guide/quic-client-block.c
index b63012829f..2c177b4f18 100644
--- a/demos/guide/quic-client-block.c
+++ b/demos/guide/quic-client-block.c
@@ -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;
}
diff --git a/demos/guide/quic-client-non-block.c b/demos/guide/quic-client-non-block.c
index be4c9b1967..e1735c0c5d 100644
--- a/demos/guide/quic-client-non-block.c
+++ b/demos/guide/quic-client-non-block.c
@@ -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;
}
diff --git a/demos/guide/quic-multi-stream.c b/demos/guide/quic-multi-stream.c
index 5b7c8581eb..8b6567aa83 100644
--- a/demos/guide/quic-multi-stream.c
+++ b/demos/guide/quic-multi-stream.c
@@ -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;
}