summaryrefslogtreecommitdiffstats
path: root/Modules/_lzmamodule.c
diff options
context:
space:
mode:
authorOren Milman <orenmn@gmail.com>2018-02-13 10:28:33 (GMT)
committerINADA Naoki <methane@users.noreply.github.com>2018-02-13 10:28:33 (GMT)
commitd019bc8319ea35e93bf4baa38098ff1b57cd3ee5 (patch)
treed9b927eba02059f8be8465d35b6969254b172b8e /Modules/_lzmamodule.c
parentaec7532ed3ccbd29d3429a3f375e25f956c44003 (diff)
downloadcpython-d019bc8319ea35e93bf4baa38098ff1b57cd3ee5.zip
cpython-d019bc8319ea35e93bf4baa38098ff1b57cd3ee5.tar.gz
cpython-d019bc8319ea35e93bf4baa38098ff1b57cd3ee5.tar.bz2
bpo-31787: Prevent refleaks when calling __init__() more than once (GH-3995)
Diffstat (limited to 'Modules/_lzmamodule.c')
-rw-r--r--Modules/_lzmamodule.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_lzmamodule.c b/Modules/_lzmamodule.c
index fd3bbb8..5bcd088 100644
--- a/Modules/_lzmamodule.c
+++ b/Modules/_lzmamodule.c
@@ -1173,7 +1173,7 @@ _lzma_LZMADecompressor___init___impl(Decompressor *self, int format,
self->needs_input = 1;
self->input_buffer = NULL;
self->input_buffer_size = 0;
- self->unused_data = PyBytes_FromStringAndSize(NULL, 0);
+ Py_XSETREF(self->unused_data, PyBytes_FromStringAndSize(NULL, 0));
if (self->unused_data == NULL)
goto error;