Mercurial > cpython-lru_cache-weakref
diff Modules/structmodule.c @ 39893:6fb46e87d5f9 2.4
[Backport of rev. 42093 by neal.norwitz]
Check return result from Py_InitModule*(). This API can fail.
Probably should be backported.
| author | Andrew M. Kuchling <amk@amk.ca> |
|---|---|
| date | Wed, 27 Sep 2006 19:17:32 +0000 |
| parents | 8a3d7f9f02cc |
| children | 9f3f87e920a6 |
line wrap: on
line diff
--- a/Modules/structmodule.c Wed Sep 27 19:04:53 2006 +0000 +++ b/Modules/structmodule.c Wed Sep 27 19:17:32 2006 +0000 @@ -1278,6 +1278,8 @@ /* 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) {
