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: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c583919ffced0a3b6409766fc12f6e28bef4fac7;p=python 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 6162c53b9e..7b2cda2183 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; }