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

index 4aa8594e765116a2817d64242f0d2c63d6d68e4f..8288c961b6d1dd15b5ac890d9500d063d95f90b7 100644 (file)
@@ -468,8 +468,10 @@ unicode_FromTclStringAndSize(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';