From: Jaeun Choi Date: Wed, 9 Aug 2017 07:39:54 +0000 (+0900) Subject: test_gesture_layer: add null checking after memory allocation X-Git-Tag: submit/tizen_3.0/20170816.054926~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4f4656da4f31f4b3260d59e8d6ce09acd134f349;p=platform%2Fupstream%2Felementary.git test_gesture_layer: add null checking after memory allocation Change-Id: Id45ecd0d3ebc4d49cab51f36f319feb813d2d828 origin: upstream (6641c07262085faf062679a21659ff7b45b05a67) --- diff --git a/src/bin/test_gesture_layer.c b/src/bin/test_gesture_layer.c index 817926792..36103ee89 100644 --- a/src/bin/test_gesture_layer.c +++ b/src/bin/test_gesture_layer.c @@ -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;