mirror of https://github.com/python/cpython
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
|
@ -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…
Reference in New Issue