Eeze_Sensor_Obj *sens;
Eeze_Sensor_Module *module = NULL;
- sens = calloc(1, sizeof(Eeze_Sensor_Obj));
- if (!sens) return NULL;
-
sens = eeze_sensor_obj_get(type);
if (!sens) return NULL;
module = _highest_priority_module_get();
- if (!module) return EINA_FALSE;
+ if (!module)
+ {
+ free(sens);
+ return EINA_FALSE;
+ }
- if (!module->read) return NULL;
+ if (!module->read)
+ {
+ free(sens);
+ return NULL;
+ }
/* The read is asynchronous here as we want to make sure that the sensor
* object has valid data when created. As we give back cached values we
if (module->read(sens->type, sens))
return sens;
+ free(sens);
return NULL;
}
default:
ERR("Not possible to read from this sensor type.");
+ free(obj);
return EINA_FALSE;
}
memcpy(lobj, obj, sizeof(Eeze_Sensor_Obj));
+ free(obj);
return EINA_TRUE;
}
default:
ERR("Not possible to set a callback for this sensor type.");
+ free(obj);
return EINA_FALSE;
}
+ free(obj);
return EINA_TRUE;
}
default:
ERR("Not possible to read from this sensor type.");
+ free(obj);
return EINA_FALSE;
}
memcpy(lobj, obj, sizeof(Eeze_Sensor_Obj));
-
+ free(obj);
sensor_stop(sensor_handle, type);
return EINA_TRUE;
}