diff options
author | Raymond Hettinger <python@rcn.com> | 2010-04-18 20:28:33 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2010-04-18 20:28:33 (GMT) |
commit | b136a9c9d718e6cc717aef45daec9e8b28423b06 (patch) | |
tree | 2569174d9bad3644fa1d988daa320415aa174c4b /Objects/setobject.c | |
parent | 79a9351b52ac69dc89d7a23c02a2ed62fe1cf534 (diff) | |
download | cpython-b136a9c9d718e6cc717aef45daec9e8b28423b06.zip cpython-b136a9c9d718e6cc717aef45daec9e8b28423b06.tar.gz cpython-b136a9c9d718e6cc717aef45daec9e8b28423b06.tar.bz2 |
Issue 8420: Fix ref counting problem in set_repr().
Diffstat (limited to 'Objects/setobject.c')
-rw-r--r-- | Objects/setobject.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/Objects/setobject.c b/Objects/setobject.c index 742dadc..d2a55fc 100644 --- a/Objects/setobject.c +++ b/Objects/setobject.c @@ -601,10 +601,8 @@ set_repr(PySetObject *so) listrepr = PyObject_Repr(keys); Py_DECREF(keys); - if (listrepr == NULL) { - Py_DECREF(keys); + if (listrepr == NULL) goto done; - } newsize = PyUnicode_GET_SIZE(listrepr); result = PyUnicode_FromUnicode(NULL, newsize); if (result) { |