Skip to content

Commit a052be4

Browse files
GH-104371: check return value of calling mv.release (#104417)
1 parent 5b8cd5a commit a052be4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Objects/typeobject.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9158,7 +9158,13 @@ releasebuffer_call_python(PyObject *self, Py_buffer *buffer)
91589158
Py_DECREF(ret);
91599159
}
91609160
if (!is_buffer_wrapper) {
9161-
PyObject_CallMethodNoArgs(mv, &_Py_ID(release));
9161+
PyObject *res = PyObject_CallMethodNoArgs(mv, &_Py_ID(release));
9162+
if (res == NULL) {
9163+
PyErr_WriteUnraisable(self);
9164+
}
9165+
else {
9166+
Py_DECREF(res);
9167+
}
91629168
}
91639169
Py_DECREF(mv);
91649170
end:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy