Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3158)

Unified Diff: chrome/installer/setup/uninstall.cc

Issue 151101: Fixit: Remove bunch of coverity warnings from chrome/installer/*. (Closed)
Patch Set: Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/installer/setup/install.cc ('k') | chrome/installer/util/copy_tree_work_item.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/setup/uninstall.cc
diff --git a/chrome/installer/setup/uninstall.cc b/chrome/installer/setup/uninstall.cc
index 37da2952fa4bb5bcc361b17abad7c616c964940e..a67e01bb1521bd4f0962006d2f4f418d4567789c 100644
--- a/chrome/installer/setup/uninstall.cc
+++ b/chrome/installer/setup/uninstall.cc
@@ -136,8 +136,10 @@ bool DeleteFilesAndFolders(const std::wstring& exe_path, bool system_uninstall,
file_util::AppendToPath(&setup_exe, file_util::GetFilenameFromPath(exe_path));
std::wstring temp_file;
- file_util::CreateTemporaryFileName(&temp_file);
- file_util::Move(setup_exe, temp_file);
+ if (!file_util::CreateTemporaryFileName(&temp_file))
+ LOG(ERROR) << "Failed to create temporary file for setup.exe.";
+ else
+ file_util::Move(setup_exe, temp_file);
// Move the browser's persisted local state
FilePath user_local_state;
@@ -145,8 +147,10 @@ bool DeleteFilesAndFolders(const std::wstring& exe_path, bool system_uninstall,
std::wstring user_local_file(
user_local_state.Append(chrome::kLocalStateFilename).value());
- file_util::CreateTemporaryFileName(local_state_path);
- file_util::CopyFile(user_local_file, *local_state_path);
+ if (!file_util::CreateTemporaryFileName(local_state_path))
+ LOG(ERROR) << "Failed to create temporary file for Local State.";
+ else
+ file_util::CopyFile(user_local_file, *local_state_path);
}
LOG(INFO) << "Deleting install path " << install_path;
« no previous file with comments | « chrome/installer/setup/install.cc ('k') | chrome/installer/util/copy_tree_work_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698