diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-12-24 10:35:35 +0200 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-12-24 10:35:35 +0200 |
commit | 5951f2300f43d75d344d542e171daed47a0382a6 (patch) | |
tree | 2e173dda0c0d4c4bf887e8a6a309430d0d9cd5be /Modules/bz2module.c | |
parent | 6ed42ea08b3a961944e94f1dd941ffabc7657065 (diff) | |
download | cpython-git-5951f2300f43d75d344d542e171daed47a0382a6.tar.gz |
Issue #20440: Massive replacing unsafe attribute setting code with special
macro Py_SETREF.
Diffstat (limited to 'Modules/bz2module.c')
-rw-r--r-- | Modules/bz2module.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Modules/bz2module.c b/Modules/bz2module.c index ae749eea4d..fe417c5ffa 100644 --- a/Modules/bz2module.c +++ b/Modules/bz2module.c @@ -1953,9 +1953,8 @@ BZ2Decomp_decompress(BZ2DecompObject *self, PyObject *args) self->running = 0; input_left += bzs->avail_in; if (input_left != 0) { - Py_DECREF(self->unused_data); - self->unused_data = - PyString_FromStringAndSize(bzs->next_in, input_left); + Py_SETREF(self->unused_data, + PyString_FromStringAndSize(bzs->next_in, input_left)); if (self->unused_data == NULL) goto error; } |