Commit d5a551c2 authored by Benjamin Peterson's avatar Benjamin Peterson Committed by Miss Islington (bot)

closes bpo-36115: Fix some reference leaks in typeobject.c. (GH-12045)



a24107b0 introduced a few refleaks.





https://bugs.python.org/issue36115
parent f57cd828
...@@ -4962,6 +4962,7 @@ add_getset(PyTypeObject *type, PyGetSetDef *gsp) ...@@ -4962,6 +4962,7 @@ add_getset(PyTypeObject *type, PyGetSetDef *gsp)
return -1; return -1;
if (PyDict_GetItemWithError(dict, PyDescr_NAME(descr))) { if (PyDict_GetItemWithError(dict, PyDescr_NAME(descr))) {
Py_DECREF(descr);
continue; continue;
} }
else if (PyErr_Occurred()) { else if (PyErr_Occurred()) {
...@@ -7689,6 +7690,7 @@ super_getattro(PyObject *self, PyObject *name) ...@@ -7689,6 +7690,7 @@ super_getattro(PyObject *self, PyObject *name)
return res; return res;
} }
else if (PyErr_Occurred()) { else if (PyErr_Occurred()) {
Py_DECREF(mro);
return NULL; return NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment