]> 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:21:22 +0000 (13:21 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Wed, 18 Aug 2004 13:21:22 +0000 (13:21 +0000)
Objects/typeobject.c

index 16cdbe8fa5e8238e889792c028abb322796702b8..9db79a7b9914b0d1061462462d5e0d9820c5d41b 100644 (file)
@@ -3129,8 +3129,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) {