e_input_backend: fix issue detected by static analysis tool 52/320752/1
authorJihoon Kim <jihoon48.kim@samsung.com>
Fri, 22 Nov 2024 01:59:40 +0000 (10:59 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Fri, 22 Nov 2024 02:24:53 +0000 (11:24 +0900)
Change-Id: I27e39ee06afd6024e81544df879171325ac72d5f
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
src/bin/inputmgr/e_input_backend.c

index dee510c9bfa9bb762d121ffec19d0be1bba42e4a..c424fd9189e0537af04a7d8dbc215dcb4e0c0e98 100644 (file)
@@ -271,7 +271,7 @@ _e_input_add_ecore_device_async_cb(void *data)
              if ((ecore_device_class_get(dev) == clas) && (!strcmp(identifier, evdev->path)))
                {
                   ERR("Found same device in device list");
-                  return;
+                  goto end;
                }
           }
      }
@@ -282,7 +282,7 @@ _e_input_add_ecore_device_async_cb(void *data)
      {
         ERR("Failed to create ecore device");
         evdev->ecore_dev = NULL;
-        return;
+        goto end;
      }
 
    ecore_device_name_set(dev, evdev->name);
@@ -314,6 +314,7 @@ _e_input_add_ecore_device_async_cb(void *data)
 
    _e_input_ecore_device_event(dev, evdev->seat ? evdev->seat->name : NULL, EINA_TRUE);
 
+end:
    E_FREE(dev_info);
 }
 
@@ -410,6 +411,8 @@ _e_input_add_ecore_device(E_Input_Evdev *evdev, Ecore_Device_Class clas, Ecore_D
    _e_input_device_event_add(evdev->name, evdev->path, evdev->seat ? evdev->seat->name : NULL, clas, subclas, EINA_TRUE);
 
    dev_info = E_NEW(E_Device_Info, 1);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(dev_info, EINA_FALSE);
+
    dev_info->evdev = evdev;
    dev_info->clas = clas;
    dev_info->subclas = subclas;
@@ -436,7 +439,7 @@ _e_input_remove_ecore_device_async_cb(void *cb_data)
    clas = dev_info->clas;
 
    dev_list = ecore_device_list();
-   if (!dev_list) return;
+   if (!dev_list) goto end;
 
    EINA_LIST_FOREACH(dev_list, l, dev)
       {
@@ -466,6 +469,7 @@ _e_input_remove_ecore_device_async_cb(void *cb_data)
            }
       }
 
+end:
    E_FREE(dev_info);
 }
 
@@ -533,6 +537,8 @@ _e_input_remove_ecore_device(E_Input_Evdev *evdev, Ecore_Device_Class clas)
      }
 
    dev_info = E_NEW(E_Device_Info, 1);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(dev_info, EINA_FALSE);
+
    dev_info->evdev = evdev;
    dev_info->clas = clas;