Index: chrome/browser/sessions/session_backend.cc |
diff --git a/chrome/browser/sessions/session_backend.cc b/chrome/browser/sessions/session_backend.cc |
index dfb1200c043ea47d516723ba010a389f9a7326e9..c06f81187963af90f225698a95ab3338502b1850 100644 |
--- a/chrome/browser/sessions/session_backend.cc |
+++ b/chrome/browser/sessions/session_backend.cc |
@@ -352,7 +352,7 @@ void SessionBackend::ResetFile() { |
net::FileStream* SessionBackend::OpenAndWriteHeader(const FilePath& path) { |
DCHECK(!path.empty()); |
- net::FileStream* file = new net::FileStream(); |
+ scoped_ptr<net::FileStream> file(new net::FileStream()); |
file->Open(path, base::PLATFORM_FILE_CREATE_ALWAYS | |
base::PLATFORM_FILE_WRITE | base::PLATFORM_FILE_EXCLUSIVE_WRITE | |
base::PLATFORM_FILE_EXCLUSIVE_READ); |
@@ -365,7 +365,7 @@ net::FileStream* SessionBackend::OpenAndWriteHeader(const FilePath& path) { |
sizeof(header), NULL); |
if (wrote != sizeof_header()) |
return NULL; |
- return file; |
+ return file.release(); |
} |
FilePath SessionBackend::GetLastSessionPath() { |