handling return value properly 42/186942/1 accepted/tizen/5.0/unified/20181102.012912 accepted/tizen/unified/20180817.061859 submit/tizen/20180816.132836 submit/tizen_5.0/20181101.000001
authorAbhishek Vijay <abhishek.v@samsung.com>
Thu, 16 Aug 2018 12:24:31 +0000 (17:54 +0530)
committerAbhishek Vijay <abhishek.v@samsung.com>
Thu, 16 Aug 2018 12:24:31 +0000 (17:54 +0530)
Change-Id: Id8d0252dbf6b53bf4236ea6dac5f1de73aa65884
Signed-off-by: Abhishek Vijay <abhishek.v@samsung.com>
src/account.c

index 223f504..aaa6400 100644 (file)
@@ -522,9 +522,11 @@ int _unregister_account_provider(pkgmgrinfo_appinfo_h package_info_handle, void*
        _D("Unregistering the Account Provider.");
 
        char* app_id = NULL;
-       int get_appid_ret = pkgmgrinfo_appinfo_get_appid(package_info_handle, &app_id);
+       int pkgmgr_ret = -1;
+
+       pkgmgr_ret = pkgmgrinfo_appinfo_get_appid(package_info_handle, &app_id);
+       retvm_if((pkgmgr_ret != PMINFO_R_OK || !app_id), pkgmgr_ret, "Error fetching app id");
 
-       retvm_if(get_appid_ret == PMINFO_R_ERROR, PMINFO_R_ERROR, "Error fetching app id");
        _D("appid : %s", app_id);
 
        int ret = ACCOUNT_ERROR_NONE;
@@ -569,7 +571,11 @@ int _on_package_app_list_received_cb(pkgmgrinfo_appinfo_h handle, void *user_dat
        int ret = ACCOUNT_ERROR_NONE;
        char* app_id = NULL;
        uid_t uid = -1;
-       pkgmgrinfo_appinfo_get_appid(handle, &app_id);
+       int pkgmgr_ret = -1;
+
+       pkgmgr_ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
+       retvm_if((pkgmgr_ret != PMINFO_R_OK || !app_id), pkgmgr_ret, "Error fetching app id");
+
        _D("appid : %s", app_id);
 
        if (pkgmgr_installer_info_get_target_uid(&uid) < 0) {