From 4f841d0be73110b53e4b1178ceff8cbd20615afe Mon Sep 17 00:00:00 2001 From: =?utf8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Wed, 18 Aug 2004 13:21:22 +0000 Subject: [PATCH] Patch #980082: Missing INCREF in PyType_Ready. --- Objects/typeobject.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 16cdbe8fa5e8..9db79a7b9914 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -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) { -- 2.47.3