app: svace fix - handle NULL var 72/154272/1 submit/tizen_4.0/20171010.055134
authorsanghyeok.oh <sanghyeok.oh@samsung.com>
Tue, 10 Oct 2017 02:51:11 +0000 (11:51 +0900)
committerHyotaek Shim <hyotaek.shim@samsung.com>
Tue, 10 Oct 2017 03:10:59 +0000 (03:10 +0000)
Change-Id: I6d2ece851362dfdbaa40e2b80d5c65d491e6956a
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
(cherry picked from commit 226bea6786b902f16a31ce908248ec00514cee51)

apps/extended-sd/src/es-home-page.c

index d24bf87..46a62a7 100644 (file)
@@ -148,6 +148,11 @@ void create_home_page_base_layout(appdata_s* ad)
        home_genlist_item_s *item;
 
        home_page_genlist_itc = elm_genlist_item_class_new();
+       if (!home_page_genlist_itc) {
+               DMSG_ERR("elm_genlist_item_class_new failed");
+               return;
+       }
+
        home_page_genlist_itc->item_style = "multiline";
        home_page_genlist_itc->func.text_get = _home_page_genlist_text_get;
        home_page_genlist_itc->func.content_get = _home_page_genlist_content_get;
@@ -168,7 +173,7 @@ void create_home_page_base_layout(appdata_s* ad)
        item = (home_genlist_item_s *)malloc(sizeof(home_genlist_item_s));
        if (!item) {
                DMSG_ERR("malloc failed");
-               return;
+               goto out;
        }
 
        item->ad = ad;
@@ -179,7 +184,7 @@ void create_home_page_base_layout(appdata_s* ad)
        item = (home_genlist_item_s *)malloc(sizeof(home_genlist_item_s));
        if (!item) {
                DMSG_ERR("malloc failed");
-               return;
+               goto out;
        }
 
        item->ad = ad;
@@ -191,7 +196,7 @@ void create_home_page_base_layout(appdata_s* ad)
        item = (home_genlist_item_s *)malloc(sizeof(home_genlist_item_s));
        if (!item) {
                DMSG_ERR("malloc failed");
-               return;
+               goto out;
        }
 
        item->ad = ad;
@@ -212,7 +217,7 @@ void create_home_page_base_layout(appdata_s* ad)
        elm_object_item_part_content_set(home_page_data->home_page_navi_it, "toolbar", next_button);
        evas_object_smart_callback_add(next_button, "clicked", _next_button_clicked_cb, ad);
 
+out:
        elm_genlist_item_class_free(home_page_genlist_itc);
-
        FUNC_END();
 }