From c583919ffced0a3b6409766fc12f6e28bef4fac7 Mon Sep 17 00:00:00 2001 From: Alexey Izbyshev Date: Wed, 22 Aug 2018 21:27:32 +0300 Subject: bpo-34462: Add missing NULL check to _copy_raw_string() (GH-8863) Reported by Svace static analyzer. --- Modules/_xxsubinterpretersmodule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/_xxsubinterpretersmodule.c b/Modules/_xxsubinterpretersmodule.c index 6162c53..7b2cda2 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; } -- cgit v0.12