summaryrefslogtreecommitdiff
path: root/src/lib/ecore_fb
diff options
context:
space:
mode:
authorJiyoun Park <jy0703.park@samsung.com>2017-08-09 11:10:20 +0900
committerJiyoun Park <jy0703.park@samsung.com>2017-08-09 11:10:20 +0900
commit1ee59694ecc8212a565b6b5bc19288286465b91e (patch)
tree47684020f0d2873fc32eef1ba8d05b328efd0d02 /src/lib/ecore_fb
parent14754744fab6e237a0a3cbf9f8f30208455e1478 (diff)
ecore_fb_li: add error handling code related with calloc
Diffstat (limited to 'src/lib/ecore_fb')
-rw-r--r--src/lib/ecore_fb/ecore_fb_li.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lib/ecore_fb/ecore_fb_li.c b/src/lib/ecore_fb/ecore_fb_li.c
index 8198fd446e..453817bf97 100644
--- a/src/lib/ecore_fb/ecore_fb_li.c
+++ b/src/lib/ecore_fb/ecore_fb_li.c
@@ -112,6 +112,9 @@ _ecore_fb_li_device_event_key(Ecore_Fb_Input_Device *dev, struct input_event *ie
112 112
113 e = calloc(1, sizeof(Ecore_Event_Key) + strlen(key) + 113 e = calloc(1, sizeof(Ecore_Event_Key) + strlen(key) +
114 strlen(keyname) + (compose ? strlen(compose) : 0) + 3); 114 strlen(keyname) + (compose ? strlen(compose) : 0) + 3);
115 if (!e)
116 return;
117
115 e->keyname = (char *)(e + 1); 118 e->keyname = (char *)(e + 1);
116 e->key = e->keyname + strlen(keyname) + 1; 119 e->key = e->keyname + strlen(keyname) + 1;
117 e->compose = (compose) ? e->key + strlen(key) + 1 : NULL; 120 e->compose = (compose) ? e->key + strlen(key) + 1 : NULL;
@@ -362,6 +365,8 @@ _ecore_fb_li_device_event_syn(Ecore_Fb_Input_Device *dev, struct input_event *ie
362 { 365 {
363 Ecore_Event_Mouse_Move *ev; 366 Ecore_Event_Mouse_Move *ev;
364 ev = calloc(1,sizeof(Ecore_Event_Mouse_Move)); 367 ev = calloc(1,sizeof(Ecore_Event_Mouse_Move));
368 if (!ev)
369 return;
365 ev->x = dev->mouse.x; 370 ev->x = dev->mouse.x;
366 ev->y = dev->mouse.y; 371 ev->y = dev->mouse.y;
367 ev->root.x = ev->x; 372 ev->root.x = ev->x;
@@ -373,6 +378,8 @@ _ecore_fb_li_device_event_syn(Ecore_Fb_Input_Device *dev, struct input_event *ie
373 { 378 {
374 Ecore_Event_Mouse_Button *ev; 379 Ecore_Event_Mouse_Button *ev;
375 ev = calloc(1, sizeof(Ecore_Event_Mouse_Button)); 380 ev = calloc(1, sizeof(Ecore_Event_Mouse_Button));
381 if (!ev)
382 return;
376 ev->x = dev->mouse.x; 383 ev->x = dev->mouse.x;
377 ev->y = dev->mouse.y; 384 ev->y = dev->mouse.y;
378 ev->root.x = ev->x; 385 ev->root.x = ev->x;
@@ -385,6 +392,8 @@ _ecore_fb_li_device_event_syn(Ecore_Fb_Input_Device *dev, struct input_event *ie
385 { 392 {
386 Ecore_Event_Mouse_Button *ev; 393 Ecore_Event_Mouse_Button *ev;
387 ev = calloc(1, sizeof(Ecore_Event_Mouse_Button)); 394 ev = calloc(1, sizeof(Ecore_Event_Mouse_Button));
395 if (!ev)
396 return;
388 ev->x = dev->mouse.x; 397 ev->x = dev->mouse.x;
389 ev->y = dev->mouse.y; 398 ev->y = dev->mouse.y;
390 ev->root.x = ev->x; 399 ev->root.x = ev->x;