Skip to content

Commit 7752d79

Browse files
sobolevnestyxx
authored andcommitted
pythongh-121791: Check for NULL in MethodDescriptor2_new in _testcapi (python#121792)
1 parent c57d062 commit 7752d79

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Modules/_testcapi/vectorcall.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,9 @@ static PyObject *
348348
MethodDescriptor2_new(PyTypeObject* type, PyObject* args, PyObject *kw)
349349
{
350350
MethodDescriptor2Object *op = PyObject_New(MethodDescriptor2Object, type);
351+
if (op == NULL) {
352+
return NULL;
353+
}
351354
op->base.vectorcall = NULL;
352355
op->vectorcall = MethodDescriptor_vectorcall;
353356
return (PyObject *)op;

0 commit comments

Comments
 (0)