summaryrefslogtreecommitdiffstats
path: root/Objects/object.c
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2003-02-05 19:35:19 (GMT)
committerTim Peters <tim.peters@gmail.com>2003-02-05 19:35:19 (GMT)
commit18e7083cda52fec41ee5583bd04a916d4a6330f7 (patch)
tree0ba968eab0c6da5190b89ebfa6d605a8534ec19e /Objects/object.c
parent6ee0480521901d3e84769d1590603f89efd456a4 (diff)
downloadcpython-18e7083cda52fec41ee5583bd04a916d4a6330f7.zip
cpython-18e7083cda52fec41ee5583bd04a916d4a6330f7.tar.gz
cpython-18e7083cda52fec41ee5583bd04a916d4a6330f7.tar.bz2
SF bug 681122: Built-in function dir() causes refcount leak in baseclasses.
merge_class_dict(): This was missing a decref. Bugfix candidate.
Diffstat (limited to 'Objects/object.c')
-rw-r--r--Objects/object.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Objects/object.c b/Objects/object.c
index e44edca..150caac 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -1656,12 +1656,15 @@ merge_class_dict(PyObject* dict, PyObject* aclass)
PyErr_Clear();
else {
for (i = 0; i < n; i++) {
+ int status;
PyObject *base = PySequence_GetItem(bases, i);
if (base == NULL) {
Py_DECREF(bases);
return -1;
}
- if (merge_class_dict(dict, base) < 0) {
+ status = merge_class_dict(dict, base);
+ Py_DECREF(base);
+ if (status < 0) {
Py_DECREF(bases);
return -1;
}