diff --git a/Modules/_xxsubinterpretersmodule.c b/Modules/_xxsubinterpretersmodule.c index 6162c53b9e6..7b2cda21830 100644 --- a/Modules/_xxsubinterpretersmodule.c +++ b/Modules/_xxsubinterpretersmodule.c @@ -15,7 +15,7 @@ _copy_raw_string(PyObject *strobj) return NULL; } char *copied = PyMem_Malloc(strlen(str)+1); - if (str == NULL) { + if (copied == NULL) { PyErr_NoMemory(); return NULL; }