Prevent from adding empty gesture event 76/290476/1
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 07:17:27 +0000 (16:17 +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 2ce98c7..b8a77d1 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: