From: Martin v. Löwis Date: Wed, 18 Aug 2004 13:16:54 +0000 (+0000) Subject: Patch #980082: Missing INCREF in PyType_Ready. X-Git-Tag: v2.4a3~207 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bf608750adb3ae13dbc20eca22a3099e810ad673;p=thirdparty%2FPython%2Fcpython.git Patch #980082: Missing INCREF in PyType_Ready. --- diff --git a/Objects/typeobject.c b/Objects/typeobject.c index b33b21c62963..6f5323e2147b 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -3143,8 +3143,10 @@ PyType_Ready(PyTypeObject *type) /* Initialize tp_base (defaults to BaseObject unless that's us) */ base = type->tp_base; - if (base == NULL && type != &PyBaseObject_Type) + if (base == NULL && type != &PyBaseObject_Type) { base = type->tp_base = &PyBaseObject_Type; + Py_INCREF(base); + } /* Initialize the base class */ if (base && base->tp_dict == NULL) {