gdiplus/tests: Don't free if alloc failed.
This commit is contained in:
parent
43324fafd9
commit
cee693108a
|
@ -34,6 +34,7 @@ static void test_Scan0(void)
|
||||||
stat = GdipCreateBitmapFromScan0(10, 10, 10, PixelFormat24bppRGB, NULL, &bm);
|
stat = GdipCreateBitmapFromScan0(10, 10, 10, PixelFormat24bppRGB, NULL, &bm);
|
||||||
expect(Ok, stat);
|
expect(Ok, stat);
|
||||||
ok(NULL != bm, "Expected bitmap to be initialized\n");
|
ok(NULL != bm, "Expected bitmap to be initialized\n");
|
||||||
|
if (stat == Ok)
|
||||||
GdipDisposeImage((GpImage*)bm);
|
GdipDisposeImage((GpImage*)bm);
|
||||||
|
|
||||||
bm = (GpBitmap*)0xdeadbeef;
|
bm = (GpBitmap*)0xdeadbeef;
|
||||||
|
@ -58,6 +59,7 @@ static void test_Scan0(void)
|
||||||
stat = GdipCreateBitmapFromScan0(10, 10, 12, PixelFormat24bppRGB, buff, &bm);
|
stat = GdipCreateBitmapFromScan0(10, 10, 12, PixelFormat24bppRGB, buff, &bm);
|
||||||
expect(Ok, stat);
|
expect(Ok, stat);
|
||||||
ok(NULL != bm, "Expected bitmap to be initialized\n");
|
ok(NULL != bm, "Expected bitmap to be initialized\n");
|
||||||
|
if (stat == Ok)
|
||||||
GdipDisposeImage((GpImage*)bm);
|
GdipDisposeImage((GpImage*)bm);
|
||||||
|
|
||||||
bm = (GpBitmap*) 0xdeadbeef;
|
bm = (GpBitmap*) 0xdeadbeef;
|
||||||
|
|
Loading…
Reference in New Issue