mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
SF bug 681122: Built-in function dir() causes refcount leak in baseclasses.
merge_class_dict(): This was missing a decref. Bugfix candidate.
This commit is contained in:
parent
6ee0480521
commit
18e7083cda
1 changed files with 4 additions and 1 deletions
|
@ -1656,12 +1656,15 @@ merge_class_dict(PyObject* dict, PyObject* aclass)
|
||||||
PyErr_Clear();
|
PyErr_Clear();
|
||||||
else {
|
else {
|
||||||
for (i = 0; i < n; i++) {
|
for (i = 0; i < n; i++) {
|
||||||
|
int status;
|
||||||
PyObject *base = PySequence_GetItem(bases, i);
|
PyObject *base = PySequence_GetItem(bases, i);
|
||||||
if (base == NULL) {
|
if (base == NULL) {
|
||||||
Py_DECREF(bases);
|
Py_DECREF(bases);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (merge_class_dict(dict, base) < 0) {
|
status = merge_class_dict(dict, base);
|
||||||
|
Py_DECREF(base);
|
||||||
|
if (status < 0) {
|
||||||
Py_DECREF(bases);
|
Py_DECREF(bases);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue