gdiplus/tests: Don't free if alloc failed.
This commit is contained in:
parent
43324fafd9
commit
cee693108a
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue