Fix for bug 9400, spotted by coverity. Bug introduced in revision
2cb4f7a4
(subversion revision r389).
--- /dev/null
+ o Minor bugfixes:
+
+ - Avoid double-closing the listener socket in our socketpair replacement
+ (used on Windows) in the case where the addresses on our opened
+ sockets don't match what we expected. Fixes bug 9400; bugfix on
+ every released Tor version. Found by Coverity.
+
goto tidy_up_and_fail;
if (size != sizeof(listen_addr))
goto abort_tidy_up_and_fail;
- tor_close_socket(listener);
/* Now check we are talking to ourself by matching port and host on the
two sockets. */
if (getsockname(connector, (struct sockaddr *) &connect_addr, &size) == -1)
|| listen_addr.sin_port != connect_addr.sin_port) {
goto abort_tidy_up_and_fail;
}
+ tor_close_socket(listener);
fd[0] = connector;
fd[1] = acceptor;