summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2010-04-18 20:26:14 (GMT)
committerRaymond Hettinger <python@rcn.com>2010-04-18 20:26:14 (GMT)
commitf88db8de767460a6a2bd4307278ba6e9253b7770 (patch)
tree18750233e32ad1e4f30bb47236ea0bca74811680
parent7276f138a533529e7687f00ef8f2be3241fad057 (diff)
downloadcpython-f88db8de767460a6a2bd4307278ba6e9253b7770.zip
cpython-f88db8de767460a6a2bd4307278ba6e9253b7770.tar.gz
cpython-f88db8de767460a6a2bd4307278ba6e9253b7770.tar.bz2
Issue 8420: Fix ref counting problem in set_repr().
-rw-r--r--Objects/setobject.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/Objects/setobject.c b/Objects/setobject.c
index c3eabf5..9447441 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) {