diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-12-24 10:35:59 +0200 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-12-24 10:35:59 +0200 |
commit | 5a57ade58ec5bee85db41b8ce1340ff077781b65 (patch) | |
tree | 2f8cf61efba46284b2d4437916bc3469d23c0ce3 /Modules/zlibmodule.c | |
parent | a198645fa0f9a9c6183c211955083765dc8ab3a8 (diff) | |
download | cpython-git-5a57ade58ec5bee85db41b8ce1340ff077781b65.tar.gz |
Issue #20440: Massive replacing unsafe attribute setting code with special
macro Py_SETREF.
Diffstat (limited to 'Modules/zlibmodule.c')
-rw-r--r-- | Modules/zlibmodule.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Modules/zlibmodule.c b/Modules/zlibmodule.c index 37307be39d..a15fdb2a07 100644 --- a/Modules/zlibmodule.c +++ b/Modules/zlibmodule.c @@ -667,8 +667,7 @@ save_unconsumed_input(compobject *self, int err) PyBytes_AS_STRING(self->unused_data), old_size); Py_MEMCPY(PyBytes_AS_STRING(new_data) + old_size, self->zst.next_in, self->zst.avail_in); - Py_DECREF(self->unused_data); - self->unused_data = new_data; + Py_SETREF(self->unused_data, new_data); self->zst.avail_in = 0; } } @@ -680,8 +679,7 @@ save_unconsumed_input(compobject *self, int err) (char *)self->zst.next_in, self->zst.avail_in); if (new_data == NULL) return -1; - Py_DECREF(self->unconsumed_tail); - self->unconsumed_tail = new_data; + Py_SETREF(self->unconsumed_tail, new_data); } return 0; } |