projects
/
oweals
/
openssl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2bd8c85
)
Close the accept socket on error
author
Matt Caswell
<matt@openssl.org>
Wed, 27 Apr 2016 11:46:51 +0000
(12:46 +0100)
committer
Matt Caswell
<matt@openssl.org>
Thu, 28 Apr 2016 12:13:09 +0000
(13:13 +0100)
When setting an accepted socket for non-blocking, if the operation fails
make sure we close the accepted socket.
Reviewed-by: Richard Levitte <levitte@openssl.org>
crypto/bio/b_sock2.c
patch
|
blob
|
history
diff --git
a/crypto/bio/b_sock2.c
b/crypto/bio/b_sock2.c
index 9f092fc0737dd92f8378857348c026be23bd194f..e876e07f1bf27024094f428bcdf6924296d13700 100644
(file)
--- a/
crypto/bio/b_sock2.c
+++ b/
crypto/bio/b_sock2.c
@@
-294,8
+294,10
@@
int BIO_accept_ex(int accept_sock, BIO_ADDR *addr_, int options)
return INVALID_SOCKET;
}
- if (!BIO_socket_nbio(accepted_sock, (options & BIO_SOCK_NONBLOCK) != 0))
+ if (!BIO_socket_nbio(accepted_sock, (options & BIO_SOCK_NONBLOCK) != 0)) {
+ closesocket(accepted_sock);
return INVALID_SOCKET;
+ }
return accepted_sock;
}