bpo-34462: Add missing NULL check to _copy_raw_string() (GH-8863)
Reported by Svace static analyzer.
This commit is contained in:
parent
e7d4b2f205
commit
c583919ffc
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue