From 1ac754fa10f5d199d19911e21185d0970cb3073f Mon Sep 17 00:00:00 2001 From: Neal Norwitz Date: Thu, 19 Jan 2006 06:09:39 +0000 Subject: Check return result from Py_InitModule*(). This API can fail. Probably should be backported. --- Python/import.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Python/import.c') diff --git a/Python/import.c b/Python/import.c index f284ff4d211..8bd25f7764d 100644 --- a/Python/import.c +++ b/Python/import.c @@ -2817,6 +2817,8 @@ initimp(void) m = Py_InitModule4("imp", imp_methods, doc_imp, NULL, PYTHON_API_VERSION); + if (m == NULL) + goto failure; d = PyModule_GetDict(m); if (setint(d, "SEARCH_ERROR", SEARCH_ERROR) < 0) goto failure; -- cgit v1.2.3