]> granicus.if.org Git - python/commitdiff
Issue 8420: Fix ref counting problem in set_repr().
authorRaymond Hettinger <python@rcn.com>
Sun, 18 Apr 2010 20:26:14 +0000 (20:26 +0000)
committerRaymond Hettinger <python@rcn.com>
Sun, 18 Apr 2010 20:26:14 +0000 (20:26 +0000)
Objects/setobject.c

index c3eabf536bbb3bfd54250330f72d25768526cbae..944744183c19797cf53e2c548cacbc1af3f636fc 100644 (file)
@@ -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) {