From: Alexey Izbyshev Date: Wed, 22 Aug 2018 18:27:32 +0000 (+0300) Subject: bpo-34462: Add missing NULL check to _copy_raw_string() (GH-8863) X-Git-Tag: v3.8.0a1~1182 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c583919ffced0a3b6409766fc12f6e28bef4fac7;p=thirdparty%2FPython%2Fcpython.git bpo-34462: Add missing NULL check to _copy_raw_string() (GH-8863) Reported by Svace static analyzer. --- diff --git a/Modules/_xxsubinterpretersmodule.c b/Modules/_xxsubinterpretersmodule.c index 6162c53b9e6f..7b2cda218309 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; }