summaryrefslogtreecommitdiff
path: root/ext/socket/socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/socket/socket.c')
-rw-r--r--ext/socket/socket.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ext/socket/socket.c b/ext/socket/socket.c
index e8ceacf6215..3605e991f02 100644
--- a/ext/socket/socket.c
+++ b/ext/socket/socket.c
@@ -92,10 +92,13 @@ static void
sock_finalize(fptr)
OpenFile *fptr;
{
- if (!fptr->f) return;
+ SOCKET s;
+ if (!fptr->f) return;
+ s = get_osfhandle(fileno(fptr->f));
myfdclose(fptr->f);
- if(fptr->f2) myfdclose(fptr->f2);
+ if (fptr->f2) myfdclose(fptr->f2);
+ closesocket(s);
}
#endif