]> 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:28:33 +0000 (20:28 +0000)
committerRaymond Hettinger <python@rcn.com>
Sun, 18 Apr 2010 20:28:33 +0000 (20:28 +0000)
Objects/setobject.c

index 742dadcaa2bf95eb71a65b08956fc7415f9d101d..d2a55fc313feb7dded5911e3fb142a15a6e08a72 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) {