mirror of
https://github.com/python/cpython
synced 2026-09-29 09:40:29 +03:00
gh-105375: Harden error handling in _testcapi/heaptype.c (#105608)
Bail on first error in heapctypesubclasswithfinalizer_finalize()
This commit is contained in:
parent
33c92c4f15
commit
d636d7dfe7
1 changed files with 4 additions and 1 deletions
|
|
@ -661,8 +661,11 @@ heapctypesubclasswithfinalizer_finalize(PyObject *self)
|
|||
goto cleanup_finalize;
|
||||
}
|
||||
oldtype = PyObject_GetAttrString(m, "HeapCTypeSubclassWithFinalizer");
|
||||
if (oldtype == NULL) {
|
||||
goto cleanup_finalize;
|
||||
}
|
||||
newtype = PyObject_GetAttrString(m, "HeapCTypeSubclass");
|
||||
if (oldtype == NULL || newtype == NULL) {
|
||||
if (newtype == NULL) {
|
||||
goto cleanup_finalize;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue