aboutsummaryrefslogtreecommitdiffhomepage
path: root/win32.c
diff options
context:
space:
mode:
authorLee Salzman <[email protected]>2012-09-11 02:28:50 +0300
committerLee Salzman <[email protected]>2012-09-11 02:28:50 +0300
commit71b75500495d5e11ba5fbe937e421b349d3d3059 (patch)
treef135a7f63f295884ac0657aea752f9b36dc1fc30 /win32.c
parentbe852c5d8ba1c4e097cc86d49ddc4998a486c0eb (diff)
downloadenet-71b75500495d5e11ba5fbe937e421b349d3d3059.tar.gz
enet-71b75500495d5e11ba5fbe937e421b349d3d3059.zip
treat destroying NULL as no-op
Diffstat (limited to 'win32.c')
-rw-r--r--win32.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/win32.c b/win32.c
index 0a213e7..708d306 100644
--- a/win32.c
+++ b/win32.c
@@ -220,7 +220,8 @@ enet_socket_accept (ENetSocket socket, ENetAddress * address)
void
enet_socket_destroy (ENetSocket socket)
{
- closesocket (socket);
+ if (socket != INVALID_SOCKET)
+ closesocket (socket);
}
int