Issue #23099: Closing io.BytesIO with exported buffer is rejected now to

prevent corrupting exported buffer.
This commit is contained in:
Serhiy Storchaka 2015-02-03 02:00:18 +02:00
parent b5e8e57555
commit c057c3859c
5 changed files with 23 additions and 7 deletions

View file

@ -657,6 +657,7 @@ PyDoc_STRVAR(close_doc,
static PyObject *
bytesio_close(bytesio *self)
{
CHECK_EXPORTS(self);
if (self->buf != NULL) {
PyMem_Free(self->buf);
self->buf = NULL;