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

From: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Fix a possible socket leak at Windows (src/backend/port/win32/socket.c)
Date: 2024-01-13 21:38:13
Message-ID: CAEudQApmU5CrKefH85VbNYE2y8H=-qqEJbg6RAPU65+vCe+89A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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>

Attachment Content-Type Size
fix-socket-leak-windows.patch application/octet-stream 386 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2024-01-13 21:41:24 Re: introduce dynamic shared memory registry
Previous Message Nathan Bossart 2024-01-13 21:28:15 Re: reorganize "Shared Memory and LWLocks" section of docs