https://github.com/python/cpython/commit/8b6d4755812d0b02e9f26beb9c9a7714e4c5ac28
commit: 8b6d4755812d0b02e9f26beb9c9a7714e4c5ac28
branch: main
author: sobolevn <[email protected]>
committer: sobolevn <[email protected]>
date: 2024-07-16T11:29:33+03:00
summary:

gh-121791: Check for `NULL` in `MethodDescriptor2_new` in `_testcapi` (#121792)

files:
M Modules/_testcapi/vectorcall.c

diff --git a/Modules/_testcapi/vectorcall.c b/Modules/_testcapi/vectorcall.c
index b30c5e8704c8af..03aaacb328e0b6 100644
--- a/Modules/_testcapi/vectorcall.c
+++ b/Modules/_testcapi/vectorcall.c
@@ -348,6 +348,9 @@ static PyObject *
 MethodDescriptor2_new(PyTypeObject* type, PyObject* args, PyObject *kw)
 {
     MethodDescriptor2Object *op = PyObject_New(MethodDescriptor2Object, type);
+    if (op == NULL) {
+        return NULL;
+    }
     op->base.vectorcall = NULL;
     op->vectorcall = MethodDescriptor_vectorcall;
     return (PyObject *)op;

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to