projects
/
folly.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
42c5202
)
Fix potential double close() on exception
v2016.12.05.00
author
Amir Shalem
<amirshalem@fb.com>
Sun, 4 Dec 2016 19:15:34 +0000
(11:15 -0800)
committer
Facebook Github Bot
<facebook-github-bot-bot@fb.com>
Sun, 4 Dec 2016 19:23:52 +0000
(11:23 -0800)
Summary:
Fix potential double close() on exception when SO_REUSEPORT fails.
The fd will be closed twice, once by close() and second by the scope guard above.
Reviewed By: yfeldblum
Differential Revision:
D4272300
fbshipit-source-id:
a163be822d7522cadb9dc3c3eddca10df453de14
folly/io/async/AsyncUDPSocket.cpp
patch
|
blob
|
history
diff --git
a/folly/io/async/AsyncUDPSocket.cpp
b/folly/io/async/AsyncUDPSocket.cpp
index 0cf9d8cfa0c3ca410ba7ef6f02c6d8f8b1fffeba..082f7994cb0af8f2ddc0318cb195853d5f04e18a 100644
(file)
--- a/
folly/io/async/AsyncUDPSocket.cpp
+++ b/
folly/io/async/AsyncUDPSocket.cpp
@@
-88,7
+88,6
@@
void AsyncUDPSocket::bind(const folly::SocketAddress& address) {
SO_REUSEPORT,
&value,
sizeof(value)) != 0) {
- ::close(socket);
throw AsyncSocketException(AsyncSocketException::NOT_OPEN,
"failed to put socket in reuse_port mode",
errno);