diff options
author | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-18 23:22:01 +0000 |
---|---|---|
committer | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-18 23:22:01 +0000 |
commit | 86cbe78d10026df1273c3939d967c6d1faeb82dd (patch) | |
tree | 7a252a2cdafba218f8db77d0b785f04e06d63d2a /chrome/renderer/renderer_glue.cc | |
parent | 9364f1b459641d32c1ef446a5e7f538eb5cb26d5 (diff) | |
download | chromium_src-86cbe78d10026df1273c3939d967c6d1faeb82dd.zip chromium_src-86cbe78d10026df1273c3939d967c6d1faeb82dd.tar.gz chromium_src-86cbe78d10026df1273c3939d967c6d1faeb82dd.tar.bz2 |
Check return value of SharedMemory::Create
(found by Coverity)
Review URL: http://codereview.chromium.org/42367
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12027 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/renderer_glue.cc')
-rw-r--r-- | chrome/renderer/renderer_glue.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/chrome/renderer/renderer_glue.cc b/chrome/renderer/renderer_glue.cc index 6ed28a0..4cf4577 100644 --- a/chrome/renderer/renderer_glue.cc +++ b/chrome/renderer/renderer_glue.cc @@ -96,9 +96,9 @@ void ScopedClipboardWriterGlue::WriteBitmapFromPixels(const void* pixels, // Allocate a shared memory buffer to hold the bitmap bits shared_buf_ = new base::SharedMemory; - shared_buf_->Create(L"", false /* read write */, true /* open existing */, - buf_size); - if (!shared_buf_ || !shared_buf_->Map(buf_size)) { + const bool created = shared_buf_ && shared_buf_->Create( + L"", false /* read write */, true /* open existing */, buf_size); + if (!shared_buf_ || !created || !shared_buf_->Map(buf_size)) { NOTREACHED(); return; } |