[Python-checkins] r51265 - python/trunk/Modules/_ctypes/_ctypes.c

thomas.heller python-checkins at python.org
Mon Aug 14 09:14:09 CEST 2006


Author: thomas.heller
Date: Mon Aug 14 09:14:09 2006
New Revision: 51265

Modified:
   python/trunk/Modules/_ctypes/_ctypes.c
Log:
Check for NULL return value from new_CArgObject().
Fixes klockwork issues #183, #184, #185.

Modified: python/trunk/Modules/_ctypes/_ctypes.c
==============================================================================
--- python/trunk/Modules/_ctypes/_ctypes.c	(original)
+++ python/trunk/Modules/_ctypes/_ctypes.c	Mon Aug 14 09:14:09 2006
@@ -1067,6 +1067,8 @@
 		struct fielddesc *fd = getentry("Z");
 
 		parg = new_CArgObject();
+		if (parg == NULL)
+			return NULL;
 		parg->pffi_type = &ffi_type_pointer;
 		parg->tag = 'Z';
 		parg->obj = fd->setfunc(&parg->value, value, 0);
@@ -1119,6 +1121,8 @@
 		struct fielddesc *fd = getentry("z");
 
 		parg = new_CArgObject();
+		if (parg == NULL)
+			return NULL;
 		parg->pffi_type = &ffi_type_pointer;
 		parg->tag = 'z';
 		parg->obj = fd->setfunc(&parg->value, value, 0);
@@ -1176,6 +1180,8 @@
 		struct fielddesc *fd = getentry("P");
 
 		parg = new_CArgObject();
+		if (parg == NULL)
+			return NULL;
 		parg->pffi_type = &ffi_type_pointer;
 		parg->tag = 'P';
 		parg->obj = fd->setfunc(&parg->value, value, 0);


More information about the Python-checkins mailing list