Commit 56ded52f authored by Serhiy Storchaka's avatar Serhiy Storchaka

Call PyErr_NoMemory() when PyMem_Malloc() fails.

parents 0823d4bf b1ebfddd
......@@ -339,8 +339,10 @@ unicodeFromTclStringAndSize(const char *s, Py_ssize_t size)
const char *e = s + size;
PyErr_Clear();
q = buf = (char *)PyMem_Malloc(size);
if (buf == NULL)
if (buf == NULL) {
PyErr_NoMemory();
return NULL;
}
while (s != e) {
if (s + 1 != e && s[0] == '\xc0' && s[1] == '\x80') {
*q++ = '\0';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment