From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Tue, 17 May 2022 15:47:50 +0000 (-0700) Subject: Fix NULL check in test_type_from_ephemeral_spec in_testcapimodule.c (GH-92863) X-Git-Tag: v3.11.0b2~85 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5c826ef0a5b64157a5943867f2013e82a9ba81f9;p=thirdparty%2FPython%2Fcpython.git Fix NULL check in test_type_from_ephemeral_spec in_testcapimodule.c (GH-92863) (cherry picked from commit 524f03c08ca6688785c0fe99d8f2b385bf92e58f) Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com> --- diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index de1a8e6c20b6..a2d9ac807400 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -1221,7 +1221,7 @@ test_type_from_ephemeral_spec(PyObject *self, PyObject *Py_UNUSED(ignored)) memcpy(name, NAME, sizeof(NAME)); doc = PyMem_New(char, sizeof(DOC)); - if (name == NULL) { + if (doc == NULL) { PyErr_NoMemory(); goto finally; }