mirror of
https://github.com/python/cpython.git
synced 2025-07-23 11:15:24 +00:00
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
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue