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

This commit is contained in:
sobolevn 2024-07-16 11:29:33 +03:00 committed by GitHub
parent 1755df7b3b
commit 8b6d475581
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;