Prevent from adding empty gesture event 71/290471/4 accepted/tizen/7.0/unified/20230328.140143
authorJihoon Kim <jihoon48.kim@samsung.com>
Mon, 27 Mar 2023 06:18:38 +0000 (15:18 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Mon, 27 Mar 2023 06:54:43 +0000 (15:54 +0900)
gesture event should not be added if allocating memory for e_info->event is failed

Change-Id: I770c8b0154cce1c5069b01af08b442881739558e
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
src/e_mod_gesture_events.c

index 9eb4ae3f01dfc8c2260e3a1576ab07cfe8d27662..d99ef7c2b4695c4089ab5b03cc634d9e0c2c121c 100644 (file)
@@ -60,9 +60,13 @@ _e_gesture_event_queue(int type, void *event)
         if (e_info->event)
           memcpy(e_info->event, event, sizeof(Ecore_Event_Mouse_Move));
      }
-    else goto error;
+   else goto error;
+
+   if (e_info->event)
+     gesture->event_queue = eina_list_append(gesture->event_queue, e_info);
+   else
+     E_FREE(e_info);
 
-   gesture->event_queue = eina_list_append(gesture->event_queue, e_info);
    return;
 
 error: