Fix a file descriptor leak when a socket fails to connect.
[GB.NET] * BUG: Fix a file descriptor leak when a socket fails to connect.
This commit is contained in:
parent
3f002896b5
commit
9b73e821ef
1 changed files with 2 additions and 2 deletions
|
@ -164,9 +164,9 @@ static void CSocket_close(CSOCKET *_object)
|
|||
THIS->DnsTool = NULL;
|
||||
}
|
||||
|
||||
if (SOCKET->status > NET_INACTIVE) /* if it's not connected, does nothing */
|
||||
{
|
||||
fd = SOCKET->socket;
|
||||
if (fd >= 0)
|
||||
{
|
||||
//fprintf(stderr, "CSocket_close: %p: set fd %d to -1\n", THIS, fd);
|
||||
SOCKET->socket = -1;
|
||||
|
||||
|
|
Loading…
Reference in a new issue