Fix bug detected from static analysis tool 97/258597/1 submit/tizen/20210521.041733 submit/tizen/20210610.085603
authorwn.jang <wn.jang@samsung.com>
Fri, 21 May 2021 02:05:26 +0000 (11:05 +0900)
committerwn.jang <wn.jang@samsung.com>
Fri, 21 May 2021 02:05:49 +0000 (11:05 +0900)
Change-Id: I044c80d5d5f291adaed1b49d21a06da621907341

src/service_main.cpp

index 944eed2b943d445cd4d57b7614ae2714572f33d0..44484fefb951154ab007bf7aae03170f7b8e54fd 100644 (file)
@@ -1327,10 +1327,16 @@ static void _package_manager_event_cb(const char *type, const char *package, pac
        if (pkginfo_found) {
                if (user) {
                        /* Try to get in user packages */
-                       pkgmgrinfo_appinfo_get_usr_list(handle, PMINFO_ALL_APP, pkg_app_list_cb, (void *)&ret, uid);
+                       ret = pkgmgrinfo_appinfo_get_usr_list(handle, PMINFO_ALL_APP, pkg_app_list_cb, (void *)&ret, uid);
+                       if (ret != PMINFO_R_OK) {
+                               MAS_LOGW("Failed to get usr pkg list from pkginfo, returned %d", ret);
+                       }
                }  else {
                        /* Try to get in global packages */
-                       pkgmgrinfo_appinfo_get_list(handle, PMINFO_ALL_APP, pkg_app_list_cb, (void *)&ret);
+                       ret pkgmgrinfo_appinfo_get_list(handle, PMINFO_ALL_APP, pkg_app_list_cb, (void *)&ret);
+                       if (ret != PMINFO_R_OK) {
+                               MAS_LOGW("Failed to get pkg list from pkginfo, returned %d", ret);
+                       }
                }
        } else {
                /* Even if we failed acquiring the pkginfo, proceed if we're uninstalling