mirror of
https://github.com/python/cpython.git
synced 2025-10-04 06:06:44 +00:00
Add what looks like a necessary call to PyErr_NoMemory() when PyMem_MALLOC()
fails.
This commit is contained in:
parent
4c87581c32
commit
5ece2fb0d1
1 changed files with 1 additions and 1 deletions
|
@ -394,7 +394,7 @@ PyInt_FromUnicode(Py_UNICODE *s, Py_ssize_t length, int base)
|
||||||
char *buffer = (char *)PyMem_MALLOC(length+1);
|
char *buffer = (char *)PyMem_MALLOC(length+1);
|
||||||
|
|
||||||
if (buffer == NULL)
|
if (buffer == NULL)
|
||||||
return NULL;
|
return PyErr_NoMemory();
|
||||||
|
|
||||||
if (PyUnicode_EncodeDecimal(s, length, buffer, NULL)) {
|
if (PyUnicode_EncodeDecimal(s, length, buffer, NULL)) {
|
||||||
PyMem_FREE(buffer);
|
PyMem_FREE(buffer);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue