summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-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 e8ceacf621..3605e991f0 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