File: arm4module.c
Function: ArmSubbufferAppIdentity_set_property
Error: returning (PyObject*)NULL without setting an exception
896 static PyObject *
897 ArmSubbufferAppIdentity_set_property (ArmSubbufferAppIdentity *self, PyObject *args)
898 {
899 	int index;
900 	const char *name_ptr;
901 	const char *value_ptr;
902 	int i;
903 
904 	/*
905 	 * Supported calling signatures:
906 	 *	set_property (index, name, value)
907 	 */
908     if (!PyArg_ParseTuple(args, "iss", &index, &name_ptr, &value_ptr))
when PyArg_ParseTuple() succeeds
taking False path
909         return NULL;
910 	if ((index < ARM_PROPERTY_MIN_ARRAY_INDEX) || (index > ARM_PROPERTY_MAX_ARRAY_INDEX))
when considering range: 20 <= value <= 0x7fffffff
taking True path
911 		return NULL;
912 
913 	/* Allocate the property array as required */
914 	if (self->arm_buffer.identity_property_array == NULL)
915 	{
916 		self->arm_buffer.identity_property_array = calloc (sizeof (arm_property_t), ARM_PROPERTY_MAX_COUNT);
917 		for (i = 0; i < ARM_PROPERTY_MAX_COUNT; i++)
918 		{
919 			((arm_property_t *) self->arm_buffer.identity_property_array) [i].name = NULL;
920 			((arm_property_t *) self->arm_buffer.identity_property_array) [i].value = NULL;
921 		}
922 	}
923 
924 	/* Prevent memory loss when overwriting a value */
925 	ArmSubbufferAppIdentity_free_property (self, index);
926 
927 	/* Copy the names */
928 	((arm_property_t *) self->arm_buffer.identity_property_array) [index].name = strndup (name_ptr, ARM_PROPERTY_NAME_MAX_CHARS);
929 	((arm_property_t *) self->arm_buffer.identity_property_array) [index].value = strndup (name_ptr, ARM_PROPERTY_VALUE_MAX_CHARS);
930 
931 	Py_INCREF(Py_None);
932 	return Py_None;
933 }
returning (PyObject*)NULL without setting an exception