]> granicus.if.org Git - python/commitdiff
Reposition the decref (spotted by eagle-eye norwitz).
authorRaymond Hettinger <python@rcn.com>
Thu, 8 Nov 2007 18:47:51 +0000 (18:47 +0000)
committerRaymond Hettinger <python@rcn.com>
Thu, 8 Nov 2007 18:47:51 +0000 (18:47 +0000)
Objects/setobject.c

index 140d9456ee72a9be10a07253532474f235590a3b..3cbcd9ec8ce1ebcb0572fec12633d432eff70e97 100644 (file)
@@ -1372,14 +1372,15 @@ set_isdisjoint(PySetObject *so, PyObject *other)
                setentry entry;
                long hash = PyObject_Hash(key);
 
-               Py_DECREF(key);
                if (hash == -1) {
+                       Py_DECREF(key);
                        Py_DECREF(it);
                        return NULL;
                }
                entry.hash = hash;
                entry.key = key;
                rv = set_contains_entry(so, &entry);
+               Py_DECREF(key);
                if (rv == -1) {
                        Py_DECREF(it);
                        return NULL;