From: sobolevn Date: Tue, 16 Jul 2024 08:29:33 +0000 (+0300) Subject: gh-121791: Check for `NULL` in `MethodDescriptor2_new` in `_testcapi` (#121792) X-Git-Tag: v3.14.0a1~1112 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8b6d4755812d0b02e9f26beb9c9a7714e4c5ac28;p=thirdparty%2FPython%2Fcpython.git gh-121791: Check for `NULL` in `MethodDescriptor2_new` in `_testcapi` (#121792) --- diff --git a/Modules/_testcapi/vectorcall.c b/Modules/_testcapi/vectorcall.c index b30c5e8704c8..03aaacb328e0 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;