[Package] Fix potential defect of nullptr dereference 81/319581/2 accepted/tizen/unified/20250214.120516 accepted/tizen/unified/x/20250218.043801
authorPiotr Kosko/Tizen API (PLT) /SRPOL/Engineer/Samsung Electronics <p.kosko@samsung.com>
Thu, 13 Feb 2025 06:20:16 +0000 (07:20 +0100)
committerPiotr Kosko <p.kosko@samsung.com>
Thu, 13 Feb 2025 09:13:58 +0000 (09:13 +0000)
Coverity - http://10.113.139.115:8081/#/project-view/12080/11248?selectedIssue=1831559

[Verification] Code compiles without errors.

Change-Id: I174a481aaa539672a9d1fd0ca9ab5f39b6e99882

src/package/package_info_provider.cc

index a1ae6508244a366b1e3090894986161fe15c8a5d..695937ecabc63add325fc298f74fce07e69a465a 100644 (file)
@@ -243,6 +243,7 @@ void GetSize(const std::string& id, int service_mode, picojson::object* out) {
     LogAndReportError(
         PlatformResult(ErrorCode::UNKNOWN_ERR, "Failed to get size"), out,
         ("pkgmgr_client_new returned nullptr"));
+    return;
   }
   int size = pkgmgr_client_usr_request_service(PM_REQUEST_GET_SIZE, service_mode, pc, NULL,
                                                id.c_str(), getuid(), NULL, NULL, NULL);