summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-19 17:28:32 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-19 17:28:32 +0000
commit6a17e1e426f02801896be02b0c1e42e7546d838a (patch)
treefaff89e241a8dd7942adef03cc613f65d5619c89
parenta45a0ed30a53ec519cbcdbdea63d2bc772f62b52 (diff)
downloadchromium_src-6a17e1e426f02801896be02b0c1e42e7546d838a.zip
chromium_src-6a17e1e426f02801896be02b0c1e42e7546d838a.tar.gz
chromium_src-6a17e1e426f02801896be02b0c1e42e7546d838a.tar.bz2
Fix a leak when we bail out early because of the wrong bpp.
BUG=none TEST=none Review URL: http://codereview.chromium.org/131118 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18823 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/renderer_host/backing_store_x.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/chrome/browser/renderer_host/backing_store_x.cc b/chrome/browser/renderer_host/backing_store_x.cc
index b5c3284..de32370 100644
--- a/chrome/browser/renderer_host/backing_store_x.cc
+++ b/chrome/browser/renderer_host/backing_store_x.cc
@@ -324,8 +324,10 @@ SkBitmap* BackingStore::PaintRectToBitmap(const gfx::Rect& rect) {
AllPlanes, ZPixmap);
// TODO(jhawkins): Need to convert the image data if the image bits per pixel
// is not 32.
- if (image->bits_per_pixel != 32)
+ if (image->bits_per_pixel != 32) {
+ XFree(image);
return NULL;
+ }
SkBitmap* bitmap = new SkBitmap();
bitmap->setConfig(SkBitmap::kARGB_8888_Config, width, height);