diff options
author | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-21 22:49:05 +0000 |
---|---|---|
committer | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-21 22:49:05 +0000 |
commit | d760b34edbc06dc5e4459066d135162a8fec76da (patch) | |
tree | 02ed3b62f951fcea3be1c8412c5f552beb01d33d /webkit | |
parent | df60edb5fcd0d8b809f1deabae75cdd013c6f748 (diff) | |
download | chromium_src-d760b34edbc06dc5e4459066d135162a8fec76da.zip chromium_src-d760b34edbc06dc5e4459066d135162a8fec76da.tar.gz chromium_src-d760b34edbc06dc5e4459066d135162a8fec76da.tar.bz2 |
Coverity: Handle negative returns.
CID=16857,16921
BUG=none
TEST=none
R=thestig@chromium.org
Review URL: http://codereview.chromium.org/7218020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89918 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/fileapi/file_system_file_util.cc | 1 | ||||
-rw-r--r-- | webkit/fileapi/obfuscated_file_system_file_util.cc | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/webkit/fileapi/file_system_file_util.cc b/webkit/fileapi/file_system_file_util.cc index fbd273e..41ff6f4 100644 --- a/webkit/fileapi/file_system_file_util.cc +++ b/webkit/fileapi/file_system_file_util.cc @@ -236,6 +236,7 @@ PlatformFileError FileSystemFileUtil::Truncate( if (error_code != base::PLATFORM_FILE_OK) { return error_code; } + DCHECK_NE(base::kInvalidPlatformFileValue, file); if (!base::TruncatePlatformFile(file, length)) error_code = base::PLATFORM_FILE_ERROR_FAILED; base::ClosePlatformFile(file); diff --git a/webkit/fileapi/obfuscated_file_system_file_util.cc b/webkit/fileapi/obfuscated_file_system_file_util.cc index c953bed..a9c1c94 100644 --- a/webkit/fileapi/obfuscated_file_system_file_util.cc +++ b/webkit/fileapi/obfuscated_file_system_file_util.cc @@ -750,6 +750,7 @@ PlatformFileError ObfuscatedFileSystemFileUtil::CreateFile( if (!created) { NOTREACHED(); if (handle) { + DCHECK_NE(base::kInvalidPlatformFileValue, *handle); base::ClosePlatformFile(*handle); QuotaFileUtil::GetInstance()->DeleteFile(context, path); } @@ -758,8 +759,10 @@ PlatformFileError ObfuscatedFileSystemFileUtil::CreateFile( file_info->data_path = data_path; FileId file_id; if (!db->AddFileInfo(*file_info, &file_id)) { - if (handle) + if (handle) { + DCHECK_NE(base::kInvalidPlatformFileValue, *handle); base::ClosePlatformFile(*handle); + } QuotaFileUtil::GetInstance()->DeleteFile(context, path); return base::PLATFORM_FILE_ERROR_FAILED; } |