Skip to content

Commit

Permalink
Add a missing call to BIO_closesocket()
Browse files Browse the repository at this point in the history
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 #21950)
  • Loading branch information
mattcaswell committed Sep 8, 2023
1 parent 38c3c1d commit cdedecd
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions demos/guide/quic-client-block.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
1 change: 1 addition & 0 deletions demos/guide/quic-client-non-block.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
1 change: 1 addition & 0 deletions demos/guide/quic-multi-stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
1 change: 1 addition & 0 deletions doc/man7/ossl-guide-quic-client-block.pod
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ for TCP).

/* Set to nonblocking mode */
if (!BIO_socket_nbio(sock, 1)) {
BIO_closesocket(sock);
sock = -1;
continue;
}
Expand Down

0 comments on commit cdedecd

Please sign in to comment.