edje_cc: add null-checking code to the ninepatch_image_info_get 48/142648/2
authorMinchul Lee <slotus.lee@samsung.com>
Wed, 2 Aug 2017 08:07:52 +0000 (17:07 +0900)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Mon, 7 Aug 2017 04:27:30 +0000 (04:27 +0000)
Change-Id: I26a0c076c025f6b44f06013bd29d50db0683db3d
Signed-off-by: Minchul Lee <slotus.lee@samsung.com>
src/bin/edje/edje_cc_handlers.c

index 34587e6..4caf39b 100644 (file)
@@ -14994,6 +14994,12 @@ Eina_Bool ninepatch_image_info_get(char* name, int *w, int *h, int* borderleft,
 
 
    info = (NinePatch_Image_Info*)calloc(1, sizeof(NinePatch_Image_Info));
+   if (!info)
+     {
+        evas_object_del(obj_img);
+        return EINA_FALSE;
+     }
+
    int info_name_size = strlen(name) + 1;
    info->name = (char*)calloc(info_name_size, sizeof(char));
    strncpy(info->name, name, info_name_size);