Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 50bf51a

Browse files
committed
Fix ref/memory leak introduced in rev 41845.
1 parent 538561e commit 50bf51a

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Objects/typeobject.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,13 +1326,15 @@ mro_internal(PyTypeObject *type)
13261326
PyErr_Format(PyExc_TypeError,
13271327
"mro() returned a non-class ('%.500s')",
13281328
cls->ob_type->tp_name);
1329+
Py_DECREF(tuple);
13291330
return -1;
13301331
}
13311332
t = (PyTypeObject*)cls;
13321333
if (!PyType_IsSubtype(solid, solid_base(t))) {
13331334
PyErr_Format(PyExc_TypeError,
13341335
"mro() returned base with unsuitable layout ('%.500s')",
13351336
t->tp_name);
1337+
Py_DECREF(tuple);
13361338
return -1;
13371339
}
13381340
}

0 commit comments

Comments
 (0)