test_gesture_layer: add null checking after memory allocation

This commit is contained in:
Jaeun Choi 2017-08-09 16:05:59 +09:00
parent 38abae53c0
commit 6641c07262
1 changed files with 3 additions and 0 deletions

View 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(4, sizeof(*photo_array));
if (!photo_array) return;
w = 480;
h = 800;