diff options
author | Raymond Hettinger <python@rcn.com> | 2003-09-16 07:11:46 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2003-09-16 07:11:46 (GMT) |
commit | a9e14b70150d5bc064afd3144097ec0095869f10 (patch) | |
tree | 2d10fb24fab34f7155b1286453391f03e26cbd06 | |
parent | 2d72b5d70723cb13eb0ad65b6deaf2a99094ac57 (diff) | |
download | cpython-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.
-rw-r--r-- | Objects/classobject.c | 1 |
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; } |