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/_bz2module.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/_bz2module.c')
-rw-r--r-- | Modules/_bz2module.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_bz2module.c b/Modules/_bz2module.c index dba0e19384..0789b6179e 100644 --- a/Modules/_bz2module.c +++ b/Modules/_bz2module.c @@ -644,7 +644,7 @@ _bz2_BZ2Decompressor___init___impl(BZ2Decompressor *self) self->bzs_avail_in_real = 0; 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; |