From 3089d01b7103fb59fc9cc90057f6be89d91074b3 Mon Sep 17 00:00:00 2001 From: "sanghyeok.oh" Date: Tue, 10 Oct 2017 11:51:11 +0900 Subject: [PATCH] app: svace fix - handle NULL var Change-Id: I6d2ece851362dfdbaa40e2b80d5c65d491e6956a Signed-off-by: sanghyeok.oh Signed-off-by: Hyotaek Shim (cherry picked from commit 226bea6786b902f16a31ce908248ec00514cee51) --- apps/extended-sd/src/es-home-page.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/apps/extended-sd/src/es-home-page.c b/apps/extended-sd/src/es-home-page.c index d24bf87..46a62a7 100644 --- a/apps/extended-sd/src/es-home-page.c +++ b/apps/extended-sd/src/es-home-page.c @@ -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(); } -- 2.7.4