From: Guido van Rossum Date: Thu, 29 Mar 2007 20:49:57 +0000 (+0000) Subject: Fix refcounting bug reported by Amaury Forgeot d'Arc. X-Git-Tag: v3.0a1~1093 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6b18a5bb3228b7af47d23941bb74d0224e2540d0;p=python Fix refcounting bug reported by Amaury Forgeot d'Arc. --- diff --git a/Objects/typeobject.c b/Objects/typeobject.c index be6f279466..1ccd97b7b2 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; }