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

Unified Diff: chrome/utility/chrome_content_utility_client.cc

Issue 683913009: Eliminate resource leaks from zip::ZipFiles and (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename file closer, add comment, reorder ZipReader/FileWrapper, change test iteration count Created 6 years, 1 month 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
Index: chrome/utility/chrome_content_utility_client.cc
diff --git a/chrome/utility/chrome_content_utility_client.cc b/chrome/utility/chrome_content_utility_client.cc
index a813cef5d3e35573a7c5e9fa26b08f5222105a9b..fa23ff226ca655285d080b9c13fe9e124de74a3f 100644
--- a/chrome/utility/chrome_content_utility_client.cc
+++ b/chrome/utility/chrome_content_utility_client.cc
@@ -249,6 +249,9 @@ void ChromeContentUtilityClient::OnCreateZipFile(
const base::FilePath& src_dir,
const std::vector<base::FilePath>& src_relative_paths,
const base::FileDescriptor& dest_fd) {
+ // dest_fd should be closed in the function. See ipc/ipc_message_util.h for
+ // details.
+ base::ScopedFD fd_closer(dest_fd.fd);
bool succeeded = true;
// Check sanity of source relative paths. Reject if path is absolute or

Powered by Google App Engine
This is Rietveld 408576698