commit | c9b0953bda1339137a7280ab1b1085abbdf4977a | [log] [tgz] |
---|---|---|
author | Georg Brandl <georg@python.org> | Sun May 25 09:24:38 2008 +0000 |
committer | Georg Brandl <georg@python.org> | Sun May 25 09:24:38 2008 +0000 |
tree | 48054e8a21b63cfb3d901133d0cda75aaf57e220 | |
parent | 38feaf0fef244879411f094a7e68f542a6771dea [diff] |
#2964: fix missing INCREF.
diff --git a/Objects/classobject.c b/Objects/classobject.c index 0e131eb..3c2bc3d 100644 --- a/Objects/classobject.c +++ b/Objects/classobject.c
@@ -501,8 +501,10 @@ static PyObject * instancemethod_descr_get(PyObject *descr, PyObject *obj, PyObject *type) { register PyObject *func = PyInstanceMethod_GET_FUNCTION(descr); - if (obj == NULL) + if (obj == NULL) { + Py_INCREF(func); return func; + } else return PyMethod_New(func, obj); }