summaryrefslogtreecommitdiff
path: root/Modules/_bz2module.c
diff options
context:
space:
mode:
authorOren Milman <orenmn@gmail.com>2018-02-13 12:28:33 +0200
committerINADA Naoki <methane@users.noreply.github.com>2018-02-13 19:28:33 +0900
commitd019bc8319ea35e93bf4baa38098ff1b57cd3ee5 (patch)
treed9b927eba02059f8be8465d35b6969254b172b8e /Modules/_bz2module.c
parentaec7532ed3ccbd29d3429a3f375e25f956c44003 (diff)
downloadcpython-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.c2
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;