Fix double free issue. 28/113228/1
authorMinsu Han <minsu81.han@samsung.com>
Tue, 7 Feb 2017 00:24:21 +0000 (09:24 +0900)
committerMinsu Han <minsu81.han@samsung.com>
Tue, 7 Feb 2017 00:28:28 +0000 (09:28 +0900)
To append device.touch_devices list in e_gesture_device_add(),
we should use strdup().
If not, in e_gesture_device_del() we have chance to meet the crash.

Change-Id: Ic78fc74cb925a2e83a5f2dccb1668d71fa5c1795
Signed-off-by: Minsu Han <minsu81.han@samsung.com>
src/e_mod_gesture_device.c

index 25b54466d6fdf47bd968e17bd85d6ef7d514a678..6e26af3591fdadfdb0715ecd43466ef694622b78 100644 (file)
@@ -89,7 +89,9 @@ e_gesture_device_add(Ecore_Event_Device_Info *ev)
 {
    if (ev->clas == ECORE_DEVICE_CLASS_TOUCH)
      {
-        gesture->device.touch_devices = eina_list_append(gesture->device.touch_devices, ev->identifier);
+        char *id;
+        id = strdup(ev->identifier);
+        gesture->device.touch_devices = eina_list_append(gesture->device.touch_devices, id);
         GTINF("%s(%s) device is touch device: add list\n", ev->name, ev->identifier);
      }
    if ((!gesture->device.kbd_identifier) &&