diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 3971062eadf..669b709613f 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -2100,6 +2100,7 @@ type_new(PyTypeObject *metatype, PyObject *args, PyObject *kwds) PyErr_Format(PyExc_ValueError, "%R in __slots__ conflicts with class variable", tmp); + Py_DECREF(newslots); goto bad_slots; } j++;