From e8b33160bb4cbf13fc0cc4fcc9feafaa5eaeca94 Mon Sep 17 00:00:00 2001 From: JengHyun Kang Date: Tue, 1 Aug 2017 21:02:08 +0900 Subject: fix svace issues Change-Id: Ia18a9d6c6b8a6e19f3998c9344744c0b75409bcf --- src/e_mod_keyrouter_events.c | 1 + src/e_mod_keyrouter_list.c | 30 +++++++++++++++++++++--------- src/e_mod_main_wl.c | 1 - 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/src/e_mod_keyrouter_events.c b/src/e_mod_keyrouter_events.c index 2a6ed84..77b669a 100644 --- a/src/e_mod_keyrouter_events.c +++ b/src/e_mod_keyrouter_events.c @@ -40,6 +40,7 @@ _e_keyrouter_event_generate_key(Ecore_Event_Key *ev, int type, struct wl_client len = sizeof(Ecore_Event_Key) + strlen(ev->key) + strlen(ev->keyname) + ((ev->compose) ? strlen(ev->compose) : 0) + 3; ev_cpy = calloc(1, len); + if (!ev_cpy) return; memcpy(ev_cpy, ev, len); ev_cpy->data = send_surface; diff --git a/src/e_mod_keyrouter_list.c b/src/e_mod_keyrouter_list.c index 81c8cf1..0e97f4d 100644 --- a/src/e_mod_keyrouter_list.c +++ b/src/e_mod_keyrouter_list.c @@ -524,13 +524,16 @@ _e_keyrouter_build_register_list(void) if (!krt->HardKeys[*ddata].registered_ptr) { node = E_NEW(E_Keyrouter_Key_List_Node, 1); - node->surface = surface; - node->wc = NULL; - node->focused = EINA_FALSE; - node->status = E_KRT_CSTAT_ALIVE; - krt->HardKeys[*ddata].registered_ptr = node; - - KLDBG("%d key's register wl_surface is %p", *ddata, surface); + if (node) + { + node->surface = surface; + node->wc = NULL; + node->focused = EINA_FALSE; + node->status = E_KRT_CSTAT_ALIVE; + krt->HardKeys[*ddata].registered_ptr = node; + + KLDBG("%d key's register wl_surface is %p", *ddata, surface); + } } } @@ -647,8 +650,11 @@ _e_keyrouter_add_registered_surface_in_list(struct wl_resource *surface, int key if (EINA_TRUE == key_finded) break; key_added = E_NEW(int, 1); - *key_added = key; - rwin_info->keys = eina_list_append(rwin_info->keys, key_added); + if (key_added) + { + *key_added = key; + rwin_info->keys = eina_list_append(rwin_info->keys, key_added); + } surface_finded = EINA_TRUE; KLDBG("Registered Key(%d) is added to wl_surface (%p)", key, surface); @@ -659,8 +665,14 @@ _e_keyrouter_add_registered_surface_in_list(struct wl_resource *surface, int key if (EINA_FALSE == surface_finded) { rwin_added = E_NEW(E_Keyrouter_Registered_Window_Info, 1); + if (!rwin_added) return; rwin_added->surface = surface; key_added = E_NEW(int, 1); + if (!key_added) + { + free(rwin_added); + return; + } *key_added = key; rwin_added->keys = eina_list_append(rwin_added->keys, key_added); krt->registered_window_list = eina_list_append(krt->registered_window_list, rwin_added); diff --git a/src/e_mod_main_wl.c b/src/e_mod_main_wl.c index bfefbd2..990dfaf 100644 --- a/src/e_mod_main_wl.c +++ b/src/e_mod_main_wl.c @@ -1009,7 +1009,6 @@ _e_keyrouter_keygrab_print(void *data, const char *log_path) fprintf(log_fl, " -- Client Information --\n"); fprintf(log_fl, " = connected fd: %d\n", wl_client_get_fd(kdata->wc)); } - break; } } -- cgit v1.2.3