Skip to content

Commit

Permalink
GH-104371: check return value of calling mv.release (#104417)
Browse files Browse the repository at this point in the history
  • Loading branch information
kumaraditya303 authored May 12, 2023
1 parent 5b8cd5a commit a052be4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit a052be4

Please sign in to comment.