summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2019-01-08 13:23:09 (GMT)
committerGitHub <noreply@github.com>2019-01-08 13:23:09 (GMT)
commita234e148394c2c7419372ab65b773d53a57f3625 (patch)
tree7c3729e94afd2ea351d3309463957cc5a84d7765 /Modules
parent872bd2b57ce8e4ea7a54acb3934222c0e4e7276b (diff)
downloadcpython-a234e148394c2c7419372ab65b773d53a57f3625.zip
cpython-a234e148394c2c7419372ab65b773d53a57f3625.tar.gz
cpython-a234e148394c2c7419372ab65b773d53a57f3625.tar.bz2
bpo-32710: Fix leak in Overlapped_WSASend() (GH-11469)
Fix a memory leak in asyncio in the ProactorEventLoop when ReadFile() or WSASend() overlapped operation fail immediately: release the internal buffer.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/overlapped.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Modules/overlapped.c b/Modules/overlapped.c
index 69875a7..bbaa4fb 100644
--- a/Modules/overlapped.c
+++ b/Modules/overlapped.c
@@ -723,6 +723,7 @@ do_ReadFile(OverlappedObject *self, HANDLE handle,
case ERROR_IO_PENDING:
Py_RETURN_NONE;
default:
+ PyBuffer_Release(&self->user_buffer);
self->type = TYPE_NOT_STARTED;
return SetFromWindowsErr(err);
}
@@ -1011,6 +1012,7 @@ Overlapped_WSASend(OverlappedObject *self, PyObject *args)
case ERROR_IO_PENDING:
Py_RETURN_NONE;
default:
+ PyBuffer_Release(&self->user_buffer);
self->type = TYPE_NOT_STARTED;
return SetFromWindowsErr(err);
}