Skip to content

Commit

Permalink
[3.12] gh-121791: Check for NULL in MethodDescriptor2_new in `_te…
Browse files Browse the repository at this point in the history
…stcapi` (GH-121792) (#121840)

gh-121791: Check for `NULL` in `MethodDescriptor2_new` in `_testcapi` (GH-121792)
(cherry picked from commit 8b6d475)

Co-authored-by: sobolevn <[email protected]>
  • Loading branch information
miss-islington and sobolevn authored Jul 16, 2024
1 parent 52df6c4 commit 106d645
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Modules/_testcapi/vectorcall.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,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;
Expand Down

0 comments on commit 106d645

Please sign in to comment.