Fix issue detected by static analysis tool 82/303982/1
authorInhong Han <inhong1.han@samsung.com>
Mon, 8 Jan 2024 04:55:53 +0000 (13:55 +0900)
committerInHong Han <inhong1.han@samsung.com>
Tue, 9 Jan 2024 00:57:11 +0000 (00:57 +0000)
Change-Id: Ic091c27710942ced633611ae75afbdb8f4d8d4ab
(cherry picked from commit ceda310410097a671f5e77b5950d7489e6f71055)

src/bin/e_input_inputs.c

index 186b4a1604a5ee63e4daf6ec5dca33cb54440b6f..78037aa5567e96da0bcf91d95c7bcd8e11d34a9f 100644 (file)
@@ -664,9 +664,10 @@ _e_input_delayed_key_events_print()
    clock_gettime(CLOCK_MONOTONIC, &tp);
    time = (tp.tv_sec * 1000) + (tp.tv_nsec / 1000000L);
 
-   for (GList *list = g_list_first(_key_event_list); list; list = list->next)
+   GList *key_list = g_list_first(_key_event_list);
+   while (key_list)
      {
-        Ecore_Event_Key *key = (Ecore_Event_Key *)list->data;
+        Ecore_Event_Key *key = (Ecore_Event_Key *)key_list->data;
         if (!key) continue;
 
         if (e_config->key_input_time_limit <= (time - key->timestamp))
@@ -676,8 +677,11 @@ _e_input_delayed_key_events_print()
           eina_stringshare_del(key->keyname);
         E_FREE(key);
 
-        _key_event_list = g_list_delete_link(_key_event_list, list);
+        GList *next = key_list->next;
+        _key_event_list = g_list_delete_link(_key_event_list, key_list);
+        key_list = next;
      }
+
    _key_event_list = NULL;
 }