mirror of
https://github.com/python/cpython.git
synced 2025-10-12 01:43:12 +00:00
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.
This commit is contained in:
parent
2d72b5d707
commit
a9e14b7015
1 changed files with 1 additions and 0 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue