Re: Fix a possible socket leak at Windows (src/backend/port/win32/socket.c)

Ranier Vilela <ranier.vf@gmail.com>

From: Ranier Vilela <ranier.vf@gmail.com>
To: Daniel Gustafsson <daniel@yesql.se>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2024-01-16T20:25:39Z
Lists: pgsql-hackers
Em seg., 15 de jan. de 2024 às 09:43, Daniel Gustafsson <daniel@yesql.se>
escreveu:

> > On 13 Jan 2024, at 22:38, Ranier Vilela <ranier.vf@gmail.com> wrote:
>
> > 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.
>
> I don't know Windows well enough to comment on the implications of not
> calling
> closesocket here, but it definitely seems like a prudent thing to do
> backpatched down to 12. Unless objections I'll do that.
>
Thanks for taking care of this.
Do you have plans or should I register for a commitfest?

Best regards,
Ranier Vilela

Commits

  1. Close socket in case of errors in setting non-blocking