eunue pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=41ea255002d93d285da331e2452488c8f6088f1f

commit 41ea255002d93d285da331e2452488c8f6088f1f
Author: Jaeun Choi <jaeun12.c...@samsung.com>
Date:   Wed Aug 9 16:02:34 2017 +0900

    elm_gesture_layer: add null checking after memory allocation
---
 src/lib/elementary/elm_gesture_layer.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/src/lib/elementary/elm_gesture_layer.c 
b/src/lib/elementary/elm_gesture_layer.c
index 6baa8417cb..7371b60e30 100644
--- a/src/lib/elementary/elm_gesture_layer.c
+++ b/src/lib/elementary/elm_gesture_layer.c
@@ -838,6 +838,8 @@ _event_history_add(Evas_Object *obj,
    ELM_GESTURE_LAYER_DATA_GET(obj, sd);
 
    ev = malloc(sizeof(Event_History));
+   if (!ev) return EINA_FALSE;
+
    ev->event = _event_info_copy(event, event_type);  /* Freed on
                                                       * _event_history_clear */
    ev->event_type = event_type;
@@ -1848,6 +1850,8 @@ _tap_gesture_test(Evas_Object *obj,
    if (!st) /* Allocated once on first time */
      {
         st = calloc(1, sizeof(Taps_Type));
+        if (!st) return;
+
         gesture->data = st;
         _tap_gestures_test_reset(gesture);
      }
@@ -2094,6 +2098,8 @@ _n_long_tap_test(Evas_Object *obj,
    if (!st) /* Allocated once on first time */
      {
         st = calloc(1, sizeof(Long_Tap_Type));
+        if (!st) return;
+
         gesture->data = st;
         _n_long_tap_test_reset(gesture);
      }
@@ -2392,6 +2398,8 @@ _momentum_test(Evas_Object *obj,
    if (!st) /* Allocated once on first time */
      {
         st = calloc(1, sizeof(Momentum_Type));
+        if (!st) return;
+
         gesture->data = st;
         _momentum_test_reset(gesture);
      }
@@ -2678,6 +2686,8 @@ _n_line_test(Evas_Object *obj,
    if (!st)
      {
         st = calloc(1, sizeof(Line_Type));
+        if (!st) return;
+
         gesture->data = st;
      }
 
@@ -3198,6 +3208,8 @@ _zoom_with_wheel_test(Evas_Object *obj,
    if (!st) /* Allocated once on first time, used for zoom intermediate data */
      {
         st = calloc(1, sizeof(Zoom_Type));
+        if (!st) return;
+
         gesture_zoom->data = st;
         _zoom_test_reset(gesture_zoom);
      }
@@ -3342,6 +3354,8 @@ _zoom_test(Evas_Object *obj,
    if (!st) /* Allocated once on first time, used for zoom data */
      {
         st = calloc(1, sizeof(Zoom_Type));
+        if (!st) return;
+
         gesture_zoom->data = st;
         _zoom_test_reset(gesture_zoom);
      }
@@ -3590,6 +3604,8 @@ _rotate_test(Evas_Object *obj,
    if (!st) /* Allocated once on first time */
      {
        st = calloc(1, sizeof(Rotate_Type));
+       if (!st) return;
+
        gesture->data = st;
        _rotate_test_reset(gesture);
      }

-- 


Reply via email to