GH-104371: check return value of calling `mv.release` (#104417)

This commit is contained in:
Kumar Aditya 2023-05-12 18:27:06 +05:30 committed by GitHub
parent 5b8cd5abe5
commit a052be4c0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -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: