diff options
-rw-r--r-- | Misc/NEWS.d/next/Library/2019-03-14-15-42-48.bpo-36289.wYKS47.rst | 1 | ||||
-rw-r--r-- | Modules/_io/bufferedio.c | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Library/2019-03-14-15-42-48.bpo-36289.wYKS47.rst b/Misc/NEWS.d/next/Library/2019-03-14-15-42-48.bpo-36289.wYKS47.rst new file mode 100644 index 0000000..8917bee --- /dev/null +++ b/Misc/NEWS.d/next/Library/2019-03-14-15-42-48.bpo-36289.wYKS47.rst @@ -0,0 +1 @@ +Fix a possible reference leak in the io module. diff --git a/Modules/_io/bufferedio.c b/Modules/_io/bufferedio.c index b8c98a4..d68f7d8 100644 --- a/Modules/_io/bufferedio.c +++ b/Modules/_io/bufferedio.c @@ -1363,6 +1363,7 @@ _bufferedreader_read_all(buffered *self) res = buffered_flush_and_rewind_unlocked(self); if (res == NULL) { Py_DECREF(chunks); + Py_XDECREF(data); return NULL; } Py_CLEAR(res); |