gdiplus/tests: Don't free if alloc failed.

This commit is contained in:
Dan Kegel 2008-01-13 17:42:28 -08:00 committed by Alexandre Julliard
parent 43324fafd9
commit cee693108a
1 changed files with 4 additions and 2 deletions

View File

@ -34,7 +34,8 @@ static void test_Scan0(void)
stat = GdipCreateBitmapFromScan0(10, 10, 10, PixelFormat24bppRGB, NULL, &bm);
expect(Ok, stat);
ok(NULL != bm, "Expected bitmap to be initialized\n");
GdipDisposeImage((GpImage*)bm);
if (stat == Ok)
GdipDisposeImage((GpImage*)bm);
bm = (GpBitmap*)0xdeadbeef;
stat = GdipCreateBitmapFromScan0(10, -10, 10, PixelFormat24bppRGB, NULL, &bm);
@ -58,7 +59,8 @@ static void test_Scan0(void)
stat = GdipCreateBitmapFromScan0(10, 10, 12, PixelFormat24bppRGB, buff, &bm);
expect(Ok, stat);
ok(NULL != bm, "Expected bitmap to be initialized\n");
GdipDisposeImage((GpImage*)bm);
if (stat == Ok)
GdipDisposeImage((GpImage*)bm);
bm = (GpBitmap*) 0xdeadbeef;
stat = GdipCreateBitmapFromScan0(10, 10, 10, PixelFormat24bppRGB, buff, &bm);