summaryrefslogtreecommitdiffstats
path: root/Modules/arraymodule.c
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2006-09-27 19:17:32 (GMT)
committerAndrew M. Kuchling <amk@amk.ca>2006-09-27 19:17:32 (GMT)
commite7031223e36c43ccd47321b3ff8997c1423e2b9c (patch)
treea8822cdeb18e24a91bd5e3e129db1cfa95d05b78 /Modules/arraymodule.c
parent4c16bac18c82868e3f20a2c4ca8f329605942ff8 (diff)
downloadcpython-e7031223e36c43ccd47321b3ff8997c1423e2b9c.zip
cpython-e7031223e36c43ccd47321b3ff8997c1423e2b9c.tar.gz
cpython-e7031223e36c43ccd47321b3ff8997c1423e2b9c.tar.bz2
[Backport of rev. 42093 by neal.norwitz]
Check return result from Py_InitModule*(). This API can fail. Probably should be backported.
Diffstat (limited to 'Modules/arraymodule.c')
-rw-r--r--Modules/arraymodule.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c
index 469c5cb..593fc48 100644
--- a/Modules/arraymodule.c
+++ b/Modules/arraymodule.c
@@ -2096,6 +2096,8 @@ initarray(void)
Arraytype.ob_type = &PyType_Type;
PyArrayIter_Type.ob_type = &PyType_Type;
m = Py_InitModule3("array", a_methods, module_doc);
+ if (m == NULL)
+ return;
Py_INCREF((PyObject *)&Arraytype);
PyModule_AddObject(m, "ArrayType", (PyObject *)&Arraytype);