summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2003-09-16 07:11:46 (GMT)
committerRaymond Hettinger <python@rcn.com>2003-09-16 07:11:46 (GMT)
commita9e14b70150d5bc064afd3144097ec0095869f10 (patch)
tree2d10fb24fab34f7155b1286453391f03e26cbd06 /Objects
parent2d72b5d70723cb13eb0ad65b6deaf2a99094ac57 (diff)
downloadcpython-a9e14b70150d5bc064afd3144097ec0095869f10.zip
cpython-a9e14b70150d5bc064afd3144097ec0095869f10.tar.gz
cpython-a9e14b70150d5bc064afd3144097ec0095869f10.tar.bz2
Fix leak in classobject.c. The leak surfaced on the error exit when
hashing a class that does not define __hash__ but does define a comparison.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/classobject.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Objects/classobject.c b/Objects/classobject.c
index 9375e07..0df249d 100644
--- a/Objects/classobject.c
+++ b/Objects/classobject.c
@@ -953,6 +953,7 @@ instance_hash(PyInstanceObject *inst)
return _Py_HashPointer(inst);
}
}
+ Py_XDECREF(func);
PyErr_SetString(PyExc_TypeError, "unhashable instance");
return -1;
}