wayland-input : check calloc returns NULL 01/264101/1
authordyamy-lee <dyamy.lee@samsung.com>
Fri, 10 Sep 2021 05:46:12 +0000 (14:46 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Mon, 13 Sep 2021 11:27:01 +0000 (20:27 +0900)
Change-Id: Ib9fa0a073f2308306fcfaccad8cec40d1e247934

src/modules/modality_keyboard/wayland-input.c

index 54c7225..ed6b9ea 100644 (file)
@@ -274,6 +274,11 @@ _input_add_key_event(unsigned int keycode, unsigned int state, unsigned int time
                LOGD("key name = %s, keycode = %d\n", name, keycode);
 
                mmi_provider_event_key *ev = calloc(1, sizeof(mmi_provider_event_key));
+               if(!ev)
+               {
+                       LOGE("mmi_provider_event_key malloc fail\n");
+                       return;
+               }
 
                if(state)
                        ev->type = MMI_EVENT_KEY_TYPE_DOWN;