Resolved Coverity Issues 1067498 1067497 1067334 1044906 1044834 32/213132/5 accepted/tizen_5.5_unified accepted/tizen_5.5_unified_mobile_hotfix accepted/tizen_5.5_unified_wearable_hotfix tizen_5.5 tizen_5.5_mobile_hotfix tizen_5.5_tv tizen_5.5_wearable_hotfix accepted/tizen/5.5/unified/20191031.014554 accepted/tizen/5.5/unified/mobile/hotfix/20201027.081304 accepted/tizen/5.5/unified/wearable/hotfix/20201027.122735 accepted/tizen/unified/20190902.220744 submit/tizen/20190902.102124 submit/tizen_5.5/20191031.000001 submit/tizen_5.5_mobile_hotfix/20201026.185101 submit/tizen_5.5_wearable_hotfix/20201026.184301 tizen_5.5.m2_release
authorprachi kumar <prachi.kumar@samsung.com>
Fri, 30 Aug 2019 20:27:39 +0000 (01:57 +0530)
committerallu.k <allu.k@samsung.com>
Mon, 2 Sep 2019 07:06:48 +0000 (12:36 +0530)
Change-Id: I19f10606c24b39a0b7388d07bb51bf44b64c2f75

src/menu_screen.c
src/pkgmgr.c

index 355f278..b0b14e3 100644 (file)
@@ -532,17 +532,20 @@ static void _language_changed_cb(app_event_info_h event_info, void *data)
                        ret = app_manager_get_app_info(package, &app_info);
                        if (ret != APP_MANAGER_ERROR_NONE || !app_info) {
                                _E("Failed to get app info");
+                               if(app_info)
+                                       app_info_destroy(app_info);
                                continue;
                        }
                        ret = app_info_get_label(app_info, &name);
                        if (APP_MANAGER_ERROR_NONE != ret) {
                                _E("Failed to get label from : %s", item_get_package(item));
+                               app_info_destroy(app_info);
                                continue;
                        }
                        _D("Changed Language name: %s", name);
-                       
-
                        item_set_name(item, name, 0);
+                       free(name);
+                       app_info_destroy(app_info);
                }
 
                mapbuf_enable(page, 1);
index 4e9252a..48a280b 100644 (file)
@@ -185,10 +185,24 @@ static bool _get_app_info_from_pkg(package_info_app_component_type_e comp_type,
 
        if (_pkgmgr_get_apps_info(app_info, &item)) {
                Evas_Object *layout = evas_object_data_get(menu_screen_get_win(), "layout");
-               if (!layout)
+               if (!layout){
+                       if (item->package){
+                               free(item->package);
+                       }
+                       if (item->data) {
+                               list_free_values(item->data);
+                               free(item->data);
+                       }
+                       free(item);
+                       app_info_destroy(app_info);
                        return false;
+               }
                layout_create_package(layout, item->data);
+               if (item->package)
+                       free(item->package);
+               free(item);
        }
+       app_info_destroy(app_info);
        return true;
 }
 
@@ -215,6 +229,7 @@ static void _pkgmgr_install(const char *package)
 
        if (package_info_foreach_app_from_package(package_info, PACKAGE_INFO_ALLAPP, _get_app_info_from_pkg, NULL)) {
                _E("Failed to install app %s", package);
+               package_info_destroy(package_info);
                return;
        }
        package_info_destroy(package_info);