Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 32feb85

Browse files
committed
Check NULL if Py_InitModule fails.
1 parent 82f6cc4 commit 32feb85

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Modules/cjkcodecs/cjkcodecs.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,8 @@ importmap(const char *modname, const char *symbol,
388388
init_codecs_##loc(void) \
389389
{ \
390390
PyObject *m = Py_InitModule("_codecs_" #loc, __methods);\
391-
(void)register_maps(m); \
391+
if (m != NULL) \
392+
(void)register_maps(m); \
392393
}
393394

394395
#endif

0 commit comments

Comments
 (0)