From 86cbe78d10026df1273c3939d967c6d1faeb82dd Mon Sep 17 00:00:00 2001 From: "agl@chromium.org" Date: Wed, 18 Mar 2009 23:22:01 +0000 Subject: 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 --- chrome/renderer/renderer_glue.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'chrome/renderer/renderer_glue.cc') 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; } -- cgit v1.1