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

Unified Diff: chrome/browser/win/jumplist.cc

Issue 2852763003: Delete JumpList temp file when failing to write the icon's content to it (Closed)
Patch Set: Fix comments. Created 3 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/win/jumplist.cc
diff --git a/chrome/browser/win/jumplist.cc b/chrome/browser/win/jumplist.cc
index 6dad5579697389d68a137d050de08c7ae6b97199..834646bb42045542cecc744d7bb9d17e0f1a7bb5 100644
--- a/chrome/browser/win/jumplist.cc
+++ b/chrome/browser/win/jumplist.cc
@@ -114,8 +114,11 @@ bool CreateIconFile(const gfx::ImageSkia& image_skia,
}
if (!IconUtil::CreateIconFileFromImageFamily(image_family, path,
- IconUtil::NORMAL_WRITE))
+ IconUtil::NORMAL_WRITE)) {
+ // Delete the file created by CreateTemporaryFileInDir as it won't be used.
+ base::DeleteFile(path, false);
return false;
+ }
// Add this icon file to the list and return its absolute path.
// The IShellLink::SetIcon() function needs the absolute path to an icon.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698