From: Neal Norwitz Date: Tue, 7 Feb 2006 06:58:52 +0000 (+0000) Subject: Check return results for errors X-Git-Tag: v2.5a0~713 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=02876df9de428c88f288808ec5c302419d79b8e6;p=python Check return results for errors --- diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c index ea5aa6cf08..a43fe2ec33 100644 --- a/Modules/_elementtree.c +++ b/Modules/_elementtree.c @@ -905,6 +905,9 @@ element_getiterator(ElementObject* self, PyObject* args) } args = PyTuple_New(2); + if (args == NULL) + return NULL; + Py_INCREF(self); PyTuple_SET_ITEM(args, 0, (PyObject*) self); Py_INCREF(tag); PyTuple_SET_ITEM(args, 1, (PyObject*) tag); @@ -2596,6 +2599,8 @@ init_elementtree(void) /* python glue code */ g = PyDict_New(); + if (g == NULL) + return; PyDict_SetItemString(g, "__builtins__", PyEval_GetBuiltins());