]> granicus.if.org Git - python/commitdiff
Check NULL if Py_InitModule fails.
authorHye-Shik Chang <hyeshik@gmail.com>
Mon, 6 Mar 2006 07:51:19 +0000 (07:51 +0000)
committerHye-Shik Chang <hyeshik@gmail.com>
Mon, 6 Mar 2006 07:51:19 +0000 (07:51 +0000)
Modules/cjkcodecs/cjkcodecs.h

index 9c321622aa75c98e4f64b4afb008eab8dca2ecf7..b266c8f9b47c848d8979408324ae74dfda4b2c17 100644 (file)
@@ -388,7 +388,8 @@ errorexit:
        init_codecs_##loc(void)                                         \
        {                                                               \
                PyObject *m = Py_InitModule("_codecs_" #loc, __methods);\
-               (void)register_maps(m);                                 \
+               if (m != NULL)                                          \
+                       (void)register_maps(m);                         \
        }
 
 #endif