summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-07-14 09:20:49 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-07-14 09:20:49 (GMT)
commit56ded52fa8bda4e85d28406a53d419cf30a8cda0 (patch)
tree72de1c8e9bac60b231ac78a0d7f5e1605550db99 /Modules
parent0823d4bfc963dc11d197154447773e00cd9598d9 (diff)
parentb1ebfdddb356d5ad63bacb10589a402c6407a86c (diff)
downloadcpython-56ded52fa8bda4e85d28406a53d419cf30a8cda0.zip
cpython-56ded52fa8bda4e85d28406a53d419cf30a8cda0.tar.gz
cpython-56ded52fa8bda4e85d28406a53d419cf30a8cda0.tar.bz2
Call PyErr_NoMemory() when PyMem_Malloc() fails.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_tkinter.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c
index 394fc8d..0acded3 100644
--- a/Modules/_tkinter.c
+++ b/Modules/_tkinter.c
@@ -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';