Hi.
While there are plans to remove the sockets functions (Windows) [1], I
believe it is worth fixing possible current bugs.
In the pgwin32_socket function (src/backend/port/win32/socket.c), there is
a possible socket leak if the socket cannot be made non-blocking.
Trivial patch attached.
Best regards,
Ranier Vilela
[1] Re: Windows sockets (select missing events?)
<https://www.postgresql.org/message-id/CA%2BhUKGKSLgxFhSP8%2BdqQqHsuZvrRRU3wZ6ytLOcno-mdGvckHg%40mail.gmail.com>