summaryrefslogtreecommitdiff
path: root/src/lib/eeze_sensor.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/eeze_sensor.c')
-rw-r--r--src/lib/eeze_sensor.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/lib/eeze_sensor.c b/src/lib/eeze_sensor.c
index 7e1f6b2..2b90555 100644
--- a/src/lib/eeze_sensor.c
+++ b/src/lib/eeze_sensor.c
@@ -41,7 +41,7 @@ EAPI Eeze_Sensor_Obj *
eeze_sensor_obj_get(Eeze_Sensor_Type sensor_type)
{
Eina_List *l;
- Eeze_Sensor_Obj *obj;
+ Eeze_Sensor_Obj *obj, *sens;
Eeze_Sensor_Module *module;
module = _highest_priority_module_get();
@@ -52,7 +52,12 @@ eeze_sensor_obj_get(Eeze_Sensor_Type sensor_type)
{
if (obj->type == sensor_type)
{
- return obj;
+ sens = calloc(1, sizeof(Eeze_Sensor_Obj));
+ if (!sens) return NULL;
+
+ memcpy(sens, obj, sizeof(Eeze_Sensor_Obj));
+
+ return sens;
}
}
return NULL;