bpo-34462: Add missing NULL check to _copy_raw_string() (GH-8863)

Reported by Svace static analyzer.
This commit is contained in:
Alexey Izbyshev 2018-08-22 21:27:32 +03:00 committed by Berker Peksag
parent e7d4b2f205
commit c583919ffc
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}