Commits

Thomas Heller  committed 64b3306

Check for NULL return value from new_CArgObject calls.

  • Participants
  • Parent commits 4f90c1d
  • Branches legacy-trunk

Comments (0)

Files changed (1)

File Modules/_ctypes/_ctypes.c

 		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);
 		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);
 		CFuncPtrObject *func;
 		func = (CFuncPtrObject *)value;
 		parg = new_CArgObject();
+		if (parg == NULL)
+			return NULL;
 		parg->pffi_type = &ffi_type_pointer;
 		parg->tag = 'P';
 		Py_INCREF(value);