summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-03-29 20:49:57 (GMT)
committerGuido van Rossum <guido@python.org>2007-03-29 20:49:57 (GMT)
commit6b18a5bb3228b7af47d23941bb74d0224e2540d0 (patch)
treea620f6b79c935ea9b60064c921d61266d13e0ed3
parent42dae6a89bd24073ae1b66599180cc94f15ff232 (diff)
downloadcpython-6b18a5bb3228b7af47d23941bb74d0224e2540d0.zip
cpython-6b18a5bb3228b7af47d23941bb74d0224e2540d0.tar.gz
cpython-6b18a5bb3228b7af47d23941bb74d0224e2540d0.tar.bz2
Fix refcounting bug reported by Amaury Forgeot d'Arc.
-rw-r--r--Objects/typeobject.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index be6f279..1ccd97b 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -2311,6 +2311,7 @@ object_richcompare(PyObject *self, PyObject *other, int op)
case Py_EQ:
res = (self == other) ? Py_True : Py_False;
+ Py_INCREF(res);
break;
case Py_NE:
@@ -2334,10 +2335,10 @@ object_richcompare(PyObject *self, PyObject *other, int op)
default:
res = Py_NotImplemented;
+ Py_INCREF(res);
break;
}
- Py_INCREF(res);
return res;
}