From bf608750adb3ae13dbc20eca22a3099e810ad673 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Wed, 18 Aug 2004 13:16:54 +0000 Subject: 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 b33b21c..6f5323e 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) { -- cgit v0.12