diff options
| author | Oren Milman <orenmn@gmail.com> | 2018-02-13 12:28:33 +0200 |
|---|---|---|
| committer | INADA Naoki <methane@users.noreply.github.com> | 2018-02-13 19:28:33 +0900 |
| commit | d019bc8319ea35e93bf4baa38098ff1b57cd3ee5 (patch) | |
| tree | d9b927eba02059f8be8465d35b6969254b172b8e /Modules/_lzmamodule.c | |
| parent | aec7532ed3ccbd29d3429a3f375e25f956c44003 (diff) | |
| download | cpython-git-d019bc8319ea35e93bf4baa38098ff1b57cd3ee5.tar.gz | |
bpo-31787: Prevent refleaks when calling __init__() more than once (GH-3995)
Diffstat (limited to 'Modules/_lzmamodule.c')
| -rw-r--r-- | Modules/_lzmamodule.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_lzmamodule.c b/Modules/_lzmamodule.c index fd3bbb80bc..5bcd088d77 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; |
