diff Modules/socketmodule.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 d5231ec6dac3
children 693ff5d73412
line wrap: on
line diff
--- a/Modules/socketmodule.c	Wed Sep 27 19:04:53 2006 +0000
+++ b/Modules/socketmodule.c	Wed Sep 27 19:17:32 2006 +0000
@@ -3872,6 +3872,8 @@
 	m = Py_InitModule3(PySocket_MODULE_NAME,
 			   socket_methods,
 			   socket_doc);
+	if (m == NULL)
+		return;
 
 	socket_error = PyErr_NewException("socket.error", NULL, NULL);
 	if (socket_error == NULL)