From b136a9c9d718e6cc717aef45daec9e8b28423b06 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Sun, 18 Apr 2010 20:28:33 +0000 Subject: [PATCH] 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 742dadcaa2..d2a55fc313 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) { -- 2.40.0