test_gesture_layer: add null checking after memory allocation 59/143259/2
authorJaeun Choi <jaeun12.choi@samsung.com>
Wed, 9 Aug 2017 07:39:54 +0000 (16:39 +0900)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Fri, 11 Aug 2017 01:43:13 +0000 (01:43 +0000)
Change-Id: Id45ecd0d3ebc4d49cab51f36f319feb813d2d828
origin: upstream (6641c07262085faf062679a21659ff7b45b05a67)

src/bin/test_gesture_layer.c

index 817926792b1a98b0eefc4b158f92fb4d251c9696..36103ee894d1314bf4ebc9d415a5d1352bd60b85 100644 (file)
@@ -289,6 +289,8 @@ photo_object_add(Evas_Object *parent, Evas_Object *ic, const char *icon, Evas_Co
    char buf[PATH_MAX];
    Photo_Object *po;
    po = calloc(1, sizeof(*po));
+   if (!po) return NULL;
+
    po->base_zoom = po->zoom = BASE_ZOOM;
 
    if (ic)
@@ -360,6 +362,7 @@ test_gesture_layer(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
    int ind = 0;
    Photo_Object **photo_array;
    photo_array = calloc(sizeof(*photo_array), 4);
+   if (!photo_array) return;
 
    w = 480;
    h = 800;