summaryrefslogtreecommitdiff
path: root/Modules/structmodule.c
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2006-09-27 19:17:32 +0000
committerAndrew M. Kuchling <amk@amk.ca>2006-09-27 19:17:32 +0000
commite7031223e36c43ccd47321b3ff8997c1423e2b9c (patch)
treea8822cdeb18e24a91bd5e3e129db1cfa95d05b78 /Modules/structmodule.c
parent4c16bac18c82868e3f20a2c4ca8f329605942ff8 (diff)
downloadcpython-git-e7031223e36c43ccd47321b3ff8997c1423e2b9c.tar.gz
[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/structmodule.c')
-rw-r--r--Modules/structmodule.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Modules/structmodule.c b/Modules/structmodule.c
index 137b8988e0..f07f21a30c 100644
--- a/Modules/structmodule.c
+++ b/Modules/structmodule.c
@@ -1278,6 +1278,8 @@ initstruct(void)
/* Create the module and add the functions */
m = Py_InitModule4("struct", struct_methods, struct__doc__,
(PyObject*)NULL, PYTHON_API_VERSION);
+ if (m == NULL)
+ return;
/* Add some symbolic constants to the module */
if (StructError == NULL) {