Fix refcounting bug reported by Amaury Forgeot d'Arc.

This commit is contained in:
Guido van Rossum 2007-03-29 20:49:57 +00:00
parent 42dae6a89b
commit 6b18a5bb32
1 changed files with 2 additions and 1 deletions

View File

@ -2311,6 +2311,7 @@ object_richcompare(PyObject *self, PyObject *other, int op)
case Py_EQ: case Py_EQ:
res = (self == other) ? Py_True : Py_False; res = (self == other) ? Py_True : Py_False;
Py_INCREF(res);
break; break;
case Py_NE: case Py_NE:
@ -2334,10 +2335,10 @@ object_richcompare(PyObject *self, PyObject *other, int op)
default: default:
res = Py_NotImplemented; res = Py_NotImplemented;
Py_INCREF(res);
break; break;
} }
Py_INCREF(res);
return res; return res;
} }