mirror of https://github.com/python/cpython
Fix a usage of the dangerous pattern decref - modify field - incref.
This commit is contained in:
parent
c0ba52d3fd
commit
796fc992ce
|
@ -265,9 +265,10 @@ type_set_bases(PyTypeObject *type, PyObject *value, void *context)
|
||||||
PyObject* mro;
|
PyObject* mro;
|
||||||
PyArg_UnpackTuple(PyList_GET_ITEM(temp, i),
|
PyArg_UnpackTuple(PyList_GET_ITEM(temp, i),
|
||||||
"", 2, 2, &cls, &mro);
|
"", 2, 2, &cls, &mro);
|
||||||
Py_DECREF(cls->tp_mro);
|
Py_INCREF(mro);
|
||||||
|
ob = cls->tp_mro;
|
||||||
cls->tp_mro = mro;
|
cls->tp_mro = mro;
|
||||||
Py_INCREF(cls->tp_mro);
|
Py_DECREF(ob);
|
||||||
}
|
}
|
||||||
Py_DECREF(temp);
|
Py_DECREF(temp);
|
||||||
goto bail;
|
goto bail;
|
||||||
|
|
Loading…
Reference in New Issue