diff Modules/cdmodule.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 6fa76b4e59fe
children 561e5f5026eb
line wrap: on
line diff
--- a/Modules/cdmodule.c	Wed Sep 27 19:04:53 2006 +0000
+++ b/Modules/cdmodule.c	Wed Sep 27 19:17:32 2006 +0000
@@ -760,6 +760,8 @@
 	PyObject *m, *d;
 
 	m = Py_InitModule("cd", CD_methods);
+	if (m == NULL)
+		return;
 	d = PyModule_GetDict(m);
 
 	CdError = PyErr_NewException("cd.error", NULL, NULL);