File: arm4module.c
Function: ArmSubbufferMetricValues_set_valid
Error: returning (PyObject*)NULL without setting an exception
2415 static PyObject *
2416 ArmSubbufferMetricValues_set_valid (ArmSubbufferMetricValues *self, PyObject *args)
2417 {
2418 	int slot;
2419 	int valid;
2420 	int i;
2421 
2422 	if (!PyArg_ParseTuple(args, "ii:set_valid", &slot, &valid))
when PyArg_ParseTuple() succeeds
taking False path
2423 		return NULL;
2424 	
2425 	if ((slot < ARM_METRIC_MIN_ARRAY_INDEX) || (slot > ARM_METRIC_MAX_ARRAY_INDEX))
when considering range: -0x80000000 <= value <= 6
taking False path
2426 		return NULL;
2427 
2428 	/* The buffer should exist already */
2429 	if (self->arm_buffer.metric_value_array == NULL)
when treating unknown const struct arm_metric_t * from arm4module.c:2429 as non-NULL
taking False path
2430 		return NULL;
2431 	
2432 	/* Find the entry */
2433 	for (i = 0; i < self->arm_buffer.count; i++)
when considering range: -0x80000000 <= value <= 0
taking False path
2434 		if (self->arm_buffer.metric_value_array [i].slot == slot)
2435 		{
2436 			((arm_metric_t *) self->arm_buffer.metric_value_array) [i].valid = valid;
2437 			return Py_None;
2438 		}
2439 
2440 	/* If we've reached here then we haven't found our entry */
2441 	return NULL;
2442 }
returning (PyObject*)NULL without setting an exception
found 3 similar trace(s) to this

File: arm4module.c
Function: ArmSubbufferMetricValues_set_valid
Error: ob_refcnt of return value is 1 too low
2415 static PyObject *
2416 ArmSubbufferMetricValues_set_valid (ArmSubbufferMetricValues *self, PyObject *args)
2417 {
2418 	int slot;
2419 	int valid;
2420 	int i;
2421 
2422 	if (!PyArg_ParseTuple(args, "ii:set_valid", &slot, &valid))
when PyArg_ParseTuple() succeeds
taking False path
2423 		return NULL;
2424 	
2425 	if ((slot < ARM_METRIC_MIN_ARRAY_INDEX) || (slot > ARM_METRIC_MAX_ARRAY_INDEX))
when considering range: -0x80000000 <= value <= 6
taking False path
2426 		return NULL;
2427 
2428 	/* The buffer should exist already */
2429 	if (self->arm_buffer.metric_value_array == NULL)
when treating unknown const struct arm_metric_t * from arm4module.c:2429 as non-NULL
taking False path
2430 		return NULL;
2431 	
2432 	/* Find the entry */
2433 	for (i = 0; i < self->arm_buffer.count; i++)
when considering range: 1 <= value <= 0x7fffffff
taking True path
2434 		if (self->arm_buffer.metric_value_array [i].slot == slot)
when treating unknown const struct arm_metric_t * from arm4module.c:2434 as non-NULL
when taking True path
2435 		{
2436 			((arm_metric_t *) self->arm_buffer.metric_value_array) [i].valid = valid;
when treating unknown struct arm_metric_t * from arm4module.c:2436 as non-NULL
ob_refcnt is now refs: 0 + N where N >= 1
2437 			return Py_None;
2438 		}
2439 
2440 	/* If we've reached here then we haven't found our entry */
2441 	return NULL;
2442 }
ob_refcnt of return value is 1 too low
was expecting final ob_refcnt to be N + 1 (for some unknown N)
due to object being referenced by: return value
but final ob_refcnt is N + 0
consider using "Py_RETURN_NONE;"