Add what looks like a necessary call to PyErr_NoMemory() when PyMem_MALLOC()

fails.
This commit is contained in:
Guido van Rossum 2007-05-15 20:39:12 +00:00
parent 0f0eb0b7fe
commit a28c291e92
1 changed files with 1 additions and 1 deletions

View File

@ -393,7 +393,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);