diff options
author | Victor Stinner <vstinner@redhat.com> | 2019-01-08 13:23:09 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-08 13:23:09 (GMT) |
commit | a234e148394c2c7419372ab65b773d53a57f3625 (patch) | |
tree | 7c3729e94afd2ea351d3309463957cc5a84d7765 /Modules | |
parent | 872bd2b57ce8e4ea7a54acb3934222c0e4e7276b (diff) | |
download | cpython-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.c | 2 |
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); } |