mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 17:01:51 +00:00
Fix leaked sockets when failing to check for updates
git-svn-id: https://svn.eduke32.com/eduke32@7028 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
eb08f1443e
commit
c67cdc00f8
1 changed files with 3 additions and 0 deletions
|
@ -81,6 +81,7 @@ int32_t G_GetVersionFromWebsite(char *buffer)
|
|||
if (connect(mysock, (struct sockaddr *)&dest_addr, sizeof(struct sockaddr)) == SOCKET_ERROR)
|
||||
{
|
||||
// initprintf("update: connect() error in G_GetVersionFromWebsite() (%d)\n",errno);
|
||||
closesocket(mysock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -88,6 +89,7 @@ int32_t G_GetVersionFromWebsite(char *buffer)
|
|||
if (bytes_sent == SOCKET_ERROR)
|
||||
{
|
||||
// initprintf("update: send() error in G_GetVersionFromWebsite() (%d)\n",errno);
|
||||
closesocket(mysock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -96,6 +98,7 @@ int32_t G_GetVersionFromWebsite(char *buffer)
|
|||
if (i < 0)
|
||||
{
|
||||
// initprintf("update: recv() returned %d\n", i);
|
||||
closesocket(mysock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue