Commit bd7195ab authored by Raymond Hettinger's avatar Raymond Hettinger

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.
parent 6ed6b430
...@@ -953,6 +953,7 @@ instance_hash(PyInstanceObject *inst) ...@@ -953,6 +953,7 @@ instance_hash(PyInstanceObject *inst)
return _Py_HashPointer(inst); return _Py_HashPointer(inst);
} }
} }
Py_XDECREF(func);
PyErr_SetString(PyExc_TypeError, "unhashable instance"); PyErr_SetString(PyExc_TypeError, "unhashable instance");
return -1; return -1;
} }
......
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