]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Patch #980082: Missing INCREF in PyType_Ready.
authorMartin v. Löwis <martin@v.loewis.de>
Wed, 18 Aug 2004 13:16:54 +0000 (13:16 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Wed, 18 Aug 2004 13:16:54 +0000 (13:16 +0000)
Objects/typeobject.c

index b33b21c62963200c9dd4f168d0e111e2c6603885..6f5323e2147bec21f6e9f1ae2a9cf03f985a575f 100644 (file)
@@ -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) {