don't free pool when allocation failed

svn path=/trunk/; revision=30690
This commit is contained in:
Christoph von Wittich
2007-11-23 10:36:00 +00:00
parent 337038529d
commit d4e96ba358
@@ -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);