From: Raymond Hettinger Date: Sun, 18 Apr 2010 20:28:33 +0000 (+0000) Subject: Issue 8420: Fix ref counting problem in set_repr(). X-Git-Tag: v3.1.3rc1~925 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b136a9c9d718e6cc717aef45daec9e8b28423b06;p=thirdparty%2FPython%2Fcpython.git Issue 8420: Fix ref counting problem in set_repr(). --- diff --git a/Objects/setobject.c b/Objects/setobject.c index 742dadcaa2bf..d2a55fc313fe 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) {