Content-Length: 256334 | pFad | http://github.com/postgrespro/postgres/commit/7cfa154d15c4a98bea0cfe26b2c78094a094650f

5C Close socket in case of errors in setting non-blocking · postgrespro/postgres@7cfa154 · GitHub
Skip to content

Commit 7cfa154

Browse files
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
1 parent 44ad512 commit 7cfa154

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/backend/port/win32/socket.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ pgwin32_socket(int af, int type, int protocol)
303303
if (ioctlsocket(s, FIONBIO, &on))
304304
{
305305
TranslateSocketError();
306+
closesocket(s);
306307
return INVALID_SOCKET;
307308
}
308309
errno = 0;

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/7cfa154d15c4a98bea0cfe26b2c78094a094650f

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy