Remove the possibility variable not be initialized 23/316123/3
authorIlho Kim <ilho159.kim@samsung.com>
Wed, 14 Aug 2024 01:07:08 +0000 (10:07 +0900)
committerIlho Kim <ilho159.kim@samsung.com>
Wed, 14 Aug 2024 01:19:10 +0000 (10:19 +0900)
Change-Id: I6e1d389dbb73088cc425731fe031b7d4bf7f1e24

src/pkgcmd/pkg_cmd.c

index a55c9490912908a088ffdc8e49bfa87bda8a7430..480583ec852c303be68cb6b8113c3e0d867c4f08 100644 (file)
@@ -1681,24 +1681,20 @@ static int __unregister_update_info_req_dispatcher(pm_tool_args *data, uid_t tar
 
        if (data->update_info_type == 0) {
                ret = pkgmgr_client_usr_unregister_pkg_update_info(pc, data->pkgid, target_uid);
-               if (ret < 0) {
+               if (ret < 0)
                        printf("unregister pkg update info failed : %d[%s]\n", ret, data->pkgid);
-                       pkgmgr_client_free(pc);
-                       return ret;
-               }
        } else if (data->update_info_type == 1) {
                ret = pkgmgr_client_usr_unregister_all_pkg_update_info(pc, target_uid);
-               if (ret < 0) {
+               if (ret < 0)
                        printf("unregister all pkg update info failed : %d\n", ret);
-                       pkgmgr_client_free(pc);
-                       return ret;
-               }
+       } else {
+               printf("Unknown update info type (%d)", data->update_info_type);
+               ret = -1;
        }
 
-       printf("unregister pkg update info ret: %d\n", ret);
        pkgmgr_client_free(pc);
 
-       return 0;
+       return ret;
 }
 
 static int __uninstall_resource_req_dispatcher(pm_tool_args *data, uid_t target_uid)