mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Issue #18408: normalizestring() now raises MemoryError on memory allocation failure
This commit is contained in:
parent
9035ad932b
commit
cc35159ed8
1 changed files with 1 additions and 1 deletions
|
@ -65,7 +65,7 @@ PyObject *normalizestring(const char *string)
|
||||||
|
|
||||||
p = PyMem_Malloc(len + 1);
|
p = PyMem_Malloc(len + 1);
|
||||||
if (p == NULL)
|
if (p == NULL)
|
||||||
return NULL;
|
return PyErr_NoMemory();
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
register char ch = string[i];
|
register char ch = string[i];
|
||||||
if (ch == ' ')
|
if (ch == ' ')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue