Fix svace issue 61/249561/2 accepted/tizen_6.5_unified accepted/tizen_7.0_unified accepted/tizen_7.0_unified_hotfix accepted/tizen_8.0_unified accepted/tizen_unified tizen tizen_6.5 tizen_7.0 tizen_7.0_hotfix tizen_8.0 accepted/tizen/6.0/unified/20211029.040351 accepted/tizen/6.5/unified/20211029.053817 accepted/tizen/7.0/unified/20221110.060219 accepted/tizen/7.0/unified/hotfix/20221116.111811 accepted/tizen/8.0/unified/20231005.095917 accepted/tizen/unified/20201218.124458 submit/tizen/20201216.005100 submit/tizen_6.5/20211028.164001 submit/tizen_6.5/20211029.140001 tizen_6.5.m2_release tizen_7.0_m2_release tizen_8.0_m2_release
authorWootak Jung <wootak.jung@samsung.com>
Tue, 15 Dec 2020 03:46:33 +0000 (12:46 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Tue, 15 Dec 2020 04:47:48 +0000 (13:47 +0900)
memory leak issue

Change-Id: I779e81e547cf9c0a780e27ae106612a0172cb417
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
src/ciss-main.c

index 7f43812..ac39340 100644 (file)
@@ -401,7 +401,11 @@ static int __ciss_relaunch_handler(void *data)
                if (ad->layout_main == NULL) {
                        Evas_Object *ly = NULL;
                        ly = _ciss_create_layout_main(ad->conformant);
-                       retv_if(ly == NULL, -1);
+                       if (ly == NULL) {
+                               g_free(launching_mode);
+                               launching_mode = NULL;
+                               return -1;
+                       }
                        ad->layout_main = ly;
                        evas_object_show(ly);
                }
@@ -425,6 +429,8 @@ static int __ciss_relaunch_handler(void *data)
 
                        ad->popup = popup;
 
+                       g_free(launching_mode);
+                       launching_mode = NULL;
                        return ret;
                }
 
@@ -447,7 +453,7 @@ static int __ciss_relaunch_handler(void *data)
                                _ciss_create_error_popup(ad->layout_main, ciss_err_code, 2.0, ad);
                        }
                }
-       } else if (strncmp(launching_mode, "RESP", 4) == 0) { 
+       } else if (strncmp(launching_mode, "RESP", 4) == 0) {
                warn("RESP");
                err = app_control_get_extra_data(ad->app_control_handle, "CISS_SIM_INDEX", &sim_index);
                if (err != APP_CONTROL_ERROR_NONE) {