mirror of https://github.com/python/cpython
GH-104371: check return value of calling `mv.release` (#104417)
This commit is contained in:
parent
5b8cd5abe5
commit
a052be4c0d
|
@ -9158,7 +9158,13 @@ releasebuffer_call_python(PyObject *self, Py_buffer *buffer)
|
|||
Py_DECREF(ret);
|
||||
}
|
||||
if (!is_buffer_wrapper) {
|
||||
PyObject_CallMethodNoArgs(mv, &_Py_ID(release));
|
||||
PyObject *res = PyObject_CallMethodNoArgs(mv, &_Py_ID(release));
|
||||
if (res == NULL) {
|
||||
PyErr_WriteUnraisable(self);
|
||||
}
|
||||
else {
|
||||
Py_DECREF(res);
|
||||
}
|
||||
}
|
||||
Py_DECREF(mv);
|
||||
end:
|
||||
|
|
Loading…
Reference in New Issue