From: Sangyoon Jang Date: Tue, 4 Apr 2023 04:52:12 +0000 (+0900) Subject: Fix static analysis issues X-Git-Tag: accepted/tizen/unified/20230406.165752~3 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fappfw%2Fapp-installers.git;a=commitdiff_plain;h=a18ea5238ed3a1534b2e7be70a1d273f26350da2 Fix static analysis issues Change-Id: Ia7ccc40f56b91a54dd93108b2c189ec7f0a0452a Signed-off-by: Sangyoon Jang --- diff --git a/src/common/step/configuration/step_parse_manifest.cc b/src/common/step/configuration/step_parse_manifest.cc index 906fda2..186b548 100644 --- a/src/common/step/configuration/step_parse_manifest.cc +++ b/src/common/step/configuration/step_parse_manifest.cc @@ -754,6 +754,7 @@ bool StepParseManifest::FillWatchApplication(manifest_x* manifest) { if (!watch_application.app_info.setup_appid().empty()) watch_app->setup_appid = strdup(watch_application.app_info.setup_appid().c_str()); + manifest->application = g_list_append(manifest->application, watch_app); if (!FillLabel(watch_app, watch_application.label)) return false; @@ -768,7 +769,6 @@ bool StepParseManifest::FillWatchApplication(manifest_x* manifest) { return false; if (!FillResControl(watch_app, watch_application.res_controls)) return false; - manifest->application = g_list_append(manifest->application, watch_app); } return true; } diff --git a/src/common/step/filesystem/step_acquire_external_storage.h b/src/common/step/filesystem/step_acquire_external_storage.h index 58c3941..8220b93 100644 --- a/src/common/step/filesystem/step_acquire_external_storage.h +++ b/src/common/step/filesystem/step_acquire_external_storage.h @@ -29,7 +29,7 @@ class StepAcquireExternalStorage : public Step { Status undo() override { return Status::OK; } Status precheck() override; - bool installed_; + bool installed_ = false; STEP_NAME(AcquireExternalStorage) }; diff --git a/src/common/step/filesystem/step_change_ownership_and_permission.h b/src/common/step/filesystem/step_change_ownership_and_permission.h index a7ee504..51df3c4 100644 --- a/src/common/step/filesystem/step_change_ownership_and_permission.h +++ b/src/common/step/filesystem/step_change_ownership_and_permission.h @@ -31,7 +31,7 @@ class StepChangeOwnershipAndPermission : public Step { Status undo() override { return Status::OK; } Status precheck() override; - bool skip_symlink_; + bool skip_symlink_ = false; STEP_NAME(ChangeOwnershipAndPermission) }; diff --git a/src/common/step/filesystem/step_recover_files.cc b/src/common/step/filesystem/step_recover_files.cc index 6eb28cb..a4ef3e8 100644 --- a/src/common/step/filesystem/step_recover_files.cc +++ b/src/common/step/filesystem/step_recover_files.cc @@ -102,7 +102,9 @@ Step::Status StepRecoverFiles::RecoveryMountUpdate() { bf::path backup_zip_location = GetBackupPathForZipFile(zip_location); if (bf::exists(backup_zip_location)) { Remove(zip_location); - MoveFile(backup_zip_location, zip_location); + if (!MoveFile(backup_zip_location, zip_location)) + LOG(ERROR) << "Failed to move " << backup_zip_location << " to " + << zip_location; } // During mount update some files are still backed up separately from zip @@ -164,4 +166,3 @@ bool StepRecoverFiles::ClearPath(const bf::path& path) { } // namespace filesystem } // namespace common_installer - diff --git a/src/common/utils/property.h b/src/common/utils/property.h index 24befbb..31e561d 100644 --- a/src/common/utils/property.h +++ b/src/common/utils/property.h @@ -24,7 +24,7 @@ class Property { Type& get() { return value_; } void set(Type val) { value_ = std::move(val); } private: - Type value_; + Type value_{}; }; #endif // COMMON_UTILS_PROPERTY_H_