From f88db8de767460a6a2bd4307278ba6e9253b7770 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Sun, 18 Apr 2010 20:26:14 +0000 Subject: Issue 8420: Fix ref counting problem in set_repr(). --- Objects/setobject.c | 4 +--- 1 file changed, 1 insertion(+), 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) { -- cgit v0.12