summaryrefslogtreecommitdiffstats
path: root/Modules/_testcapi
diff options
context:
space:
mode:
authorsobolevn <mail@sobolevn.me>2024-07-16 08:29:33 (GMT)
committerGitHub <noreply@github.com>2024-07-16 08:29:33 (GMT)
commit8b6d4755812d0b02e9f26beb9c9a7714e4c5ac28 (patch)
treed74370b82aac9d3780527358e9e753e549c7d052 /Modules/_testcapi
parent1755df7b3bf5aaaba55fd7ec02a91d99305e362e (diff)
downloadcpython-8b6d4755812d0b02e9f26beb9c9a7714e4c5ac28.zip
cpython-8b6d4755812d0b02e9f26beb9c9a7714e4c5ac28.tar.gz
cpython-8b6d4755812d0b02e9f26beb9c9a7714e4c5ac28.tar.bz2
gh-121791: Check for `NULL` in `MethodDescriptor2_new` in `_testcapi` (#121792)
Diffstat (limited to 'Modules/_testcapi')
-rw-r--r--Modules/_testcapi/vectorcall.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Modules/_testcapi/vectorcall.c b/Modules/_testcapi/vectorcall.c
index b30c5e8..03aaacb 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;