From: Raymond Hettinger Date: Sun, 18 Apr 2010 20:26:14 +0000 (+0000) Subject: Issue 8420: Fix ref counting problem in set_repr(). X-Git-Tag: v3.2a1~1108 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f88db8de767460a6a2bd4307278ba6e9253b7770;p=python Issue 8420: Fix ref counting problem in set_repr(). --- diff --git a/Objects/setobject.c b/Objects/setobject.c index c3eabf536b..944744183c 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) {