]> granicus.if.org Git - python/commitdiff
Call PyErr_NoMemory() when PyMem_Malloc() fails.
authorSerhiy Storchaka <storchaka@gmail.com>
Mon, 14 Jul 2014 09:20:15 +0000 (12:20 +0300)
committerSerhiy Storchaka <storchaka@gmail.com>
Mon, 14 Jul 2014 09:20:15 +0000 (12:20 +0300)
Modules/_tkinter.c

index 4a7b284b267b1ea3511ec9ba266df1aa6ebe0327..e3d3757bb61a03f89a800e3e48d9ea47e54f647a 100644 (file)
@@ -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';