diff Python/import.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 172fcd9c1952
children de7c0cb5a872
line wrap: on
line diff
--- a/Python/import.c	Wed Sep 27 19:04:53 2006 +0000
+++ b/Python/import.c	Wed Sep 27 19:17:32 2006 +0000
@@ -2822,6 +2822,8 @@
 
 	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;