From: Jihoon Kim Date: Fri, 22 Nov 2024 01:59:40 +0000 (+0900) Subject: e_input_backend: fix issue detected by static analysis tool X-Git-Tag: accepted/tizen/unified/20241122.171543~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F52%2F320752%2F1;p=platform%2Fupstream%2Fenlightenment.git e_input_backend: fix issue detected by static analysis tool Change-Id: I27e39ee06afd6024e81544df879171325ac72d5f Signed-off-by: Jihoon Kim --- diff --git a/src/bin/inputmgr/e_input_backend.c b/src/bin/inputmgr/e_input_backend.c index dee510c9bf..c424fd9189 100644 --- a/src/bin/inputmgr/e_input_backend.c +++ b/src/bin/inputmgr/e_input_backend.c @@ -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;