pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Daniel Gustafsson <dgustafsson@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Close socket in case of errors in setting non-blocking
Date: Wed, 17 Jan 2024 10:33:52 +0000
Message-ID: <E1rQ3F2-001pYg-07@gemulon.postgresql.org> (raw)

Close socket in case of errors in setting non-blocking

If configuring the newly created socket non-blocking fails we
error out and return INVALID_SOCKET, but the socket that had
been created wasn't closed. Fix by issuing closesocket in the
errorpath.

Backpatch to all supported branches.

Author: Ranier Vilela <ranier.vf@gmail.com>
Discussion: https://postgr.es/m/CAEudQApmU5CrKefH85VbNYE2y8H=-qqEJbg6RAPU65+vCe+89A@mail.gmail.com
Backpatch-through: v12

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/6614d38d8780670d2337090bdf2ec81c0b8bab8e

Modified Files
--------------
src/backend/port/win32/socket.c | 1 +
1 file changed, 1 insertion(+)



view thread (6+ messages)  latest in thread

Message-ID: <E1rQ3F2-001pYg-07@gemulon.postgresql.org>
Permalink:  ../E1rQ3F2-001pYg-07@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1rQ3F2-001pYg-07@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: dgustafsson@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Close socket in case of errors in setting non-blocking
  In-Reply-To: <E1rQ3F2-001pYg-07@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox