You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudberry.apache.org by le...@apache.org on 2026/09/29 13:22:20 UTC
(cloudberry) 30/50: Close socket in case of errors in setting non-blocking
This is an automated email from the ASF dual-hosted git repository.
leborchuk pushed a commit to branch REL_2_STABLE
in repository https://gitbox.apache.org/repos/asf/cloudberry.git
commit f19c2832221a2453a4f3bbd40b8023dbefbfa362
Author: Daniel Gustafsson <dg...@postgresql.org>
AuthorDate: Wed Jan 17 11:24:11 2024 +0100
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 <ra...@gmail.com>
Discussion: https://postgr.es/m/CAEudQApmU5CrKefH85VbNYE2y8H=-qqEJbg6RAPU65+vCe+89A@mail.gmail.com
Backpatch-through: v12
(cherry picked from commit d8f6ab5f66a3fcce61694308172ffd6c9e04d6b2)
---
src/backend/port/win32/socket.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/backend/port/win32/socket.c b/src/backend/port/win32/socket.c
index af151e84709..4dd57440cac 100644
--- a/src/backend/port/win32/socket.c
+++ b/src/backend/port/win32/socket.c
@@ -298,6 +298,7 @@ pgwin32_socket(int af, int type, int protocol)
if (ioctlsocket(s, FIONBIO, &on))
{
TranslateSocketError();
+ closesocket(s);
return INVALID_SOCKET;
}
errno = 0;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org