summaryrefslogtreecommitdiff
path: root/Objects/unicodeobject.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-12-24 10:35:35 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2015-12-24 10:35:35 +0200
commit5951f2300f43d75d344d542e171daed47a0382a6 (patch)
tree2e173dda0c0d4c4bf887e8a6a309430d0d9cd5be /Objects/unicodeobject.c
parent6ed42ea08b3a961944e94f1dd941ffabc7657065 (diff)
downloadcpython-git-5951f2300f43d75d344d542e171daed47a0382a6.tar.gz
Issue #20440: Massive replacing unsafe attribute setting code with special
macro Py_SETREF.
Diffstat (limited to 'Objects/unicodeobject.c')
-rw-r--r--Objects/unicodeobject.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 2925651f0e..9f503bde63 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -436,8 +436,7 @@ int _PyUnicode_Resize(PyUnicodeObject **unicode, Py_ssize_t length)
return -1;
Py_UNICODE_COPY(w->str, v->str,
length < v->length ? length : v->length);
- Py_DECREF(*unicode);
- *unicode = w;
+ Py_SETREF(*unicode, w);
return 0;
}