From d4e96ba3588258bda59694fda06a17fd08d93444 Mon Sep 17 00:00:00 2001 From: Christoph von Wittich Date: Fri, 23 Nov 2007 10:36:00 +0000 Subject: [PATCH] don't free pool when allocation failed svn path=/trunk/; revision=30690 --- reactos/subsystems/win32/win32k/objects/bitmaps.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reactos/subsystems/win32/win32k/objects/bitmaps.c b/reactos/subsystems/win32/win32k/objects/bitmaps.c index 6918a68877c..51a91f9c304 100644 --- a/reactos/subsystems/win32/win32k/objects/bitmaps.c +++ b/reactos/subsystems/win32/win32k/objects/bitmaps.c @@ -662,6 +662,11 @@ BITMAPOBJ_CopyBitmap(HBITMAP hBitmap) if (resBitmap) { buf = ExAllocatePoolWithTag (PagedPool, bm.bmWidthBytes * abs(bm.bmHeight), TAG_BITMAP); + if (buf == NULL) + { + GDIOBJ_UnlockObjByPtr(GdiHandleTable, resBitmap); + return 0; + } IntGetBitmapBits (Bitmap, bm.bmWidthBytes * abs(bm.bmHeight), buf); IntSetBitmapBits (resBitmap, bm.bmWidthBytes * abs(bm.bmHeight), buf); ExFreePool (buf);