summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1996-12-17 01:02:18 (GMT)
committerGuido van Rossum <guido@python.org>1996-12-17 01:02:18 (GMT)
commit0f868375ff991ad24fa7a9b79ceea9b64478c642 (patch)
treecf8d94bd732e2f227e4bc9c8328972a1ece9b5c8 /Modules
parentfc93f75da75e430a20b37f2a73dacfa94d8a9758 (diff)
downloadcpython-0f868375ff991ad24fa7a9b79ceea9b64478c642.zip
cpython-0f868375ff991ad24fa7a9b79ceea9b64478c642.tar.gz
cpython-0f868375ff991ad24fa7a9b79ceea9b64478c642.tar.bz2
Check errors returned by recursive call to Split().
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_tkinter.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c
index 10d9f9f..3ce0fac 100644
--- a/Modules/_tkinter.c
+++ b/Modules/_tkinter.c
@@ -261,13 +261,20 @@ Split (self, list)
v = PyString_FromString ("");
else if (argc == 1)
v = PyString_FromString (argv[0]);
- else
+ else if ((v = PyTuple_New (argc)) != NULL)
{
int i;
-
- v = PyTuple_New (argc);
- for (i = 0; i < argc; i++)
- PyTuple_SetItem (v, i, Split (self, argv[i]));
+ PyObject *w;
+
+ for (i = 0; i < argc; i++) {
+ if ((w = Split (self, argv[i])) == NULL)
+ {
+ Py_DECREF(v);
+ v = NULL;
+ break;
+ }
+ PyTuple_SetItem (v, i, w);
+ }
}
ckfree (FREECAST argv);