sslh-select: invoke FD_CLR on fd before closing fd

POSIX requires the fd argument to any FD_ macro to be valid.
This commit is contained in:
Oleg Oshmyan 2017-09-09 00:59:55 +03:00
parent b56f302b85
commit b7fafb5039

View File

@ -61,9 +61,9 @@ int tidy_connection(struct connection *cnx, fd_set *fds, fd_set *fds2)
if (verbose)
fprintf(stderr, "closing fd %d\n", cnx->q[i].fd);
close(cnx->q[i].fd);
FD_CLR(cnx->q[i].fd, fds);
FD_CLR(cnx->q[i].fd, fds2);
close(cnx->q[i].fd);
if (cnx->q[i].deferred_data)
free(cnx->q[i].deferred_data);
}