Commit fa972c98 authored by Guido van Rossum's avatar Guido van Rossum

In dealloc(), only close the socket if fd != -1.

parent 7aff6f34
......@@ -1356,6 +1356,7 @@ static PyMethodDef PySocketSock_methods[] = {
static void
BUILD_FUNC_DEF_1(PySocketSock_dealloc,PySocketSockObject *,s)
{
if (s->sock_fd != -1)
(void) close(s->sock_fd);
PyMem_DEL(s);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment