From 7f9d5aad7ca1b6468df4aa9259f4b4fcaa588555 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Fri, 11 Dec 2009 15:14:32 +0300 Subject: [PATCH] oleaut32/tests: Fix a couple of leaks in tests. --- dlls/oleaut32/tests/olepicture.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/dlls/oleaut32/tests/olepicture.c b/dlls/oleaut32/tests/olepicture.c index 55d883bb7d3..c8ddc8a7348 100644 --- a/dlls/oleaut32/tests/olepicture.c +++ b/dlls/oleaut32/tests/olepicture.c @@ -357,6 +357,7 @@ static void test_empty_image(void) { ok (hres == S_OK,"empty picture get handle failed with hres 0x%08x\n", hres); ok (handle == 0, "empty picture get handle did not return 0, but 0x%08x\n", handle); IPicture_Release (pic); + IStream_Release (stream); } static void test_empty_image_2(void) { @@ -395,6 +396,7 @@ static void test_empty_image_2(void) { ok (type == PICTYPE_NONE,"type is %d, but should be PICTYPE_NONE(0)\n", type); IPicture_Release (pic); + IStream_Release (stream); } static void test_Invoke(void) @@ -408,16 +410,17 @@ static void test_Invoke(void) HGLOBAL hglob; void *data; - hglob = GlobalAlloc (0, sizeof(gifimage)); - data = GlobalLock(hglob); - memcpy(data, gifimage, sizeof(gifimage)); + hglob = GlobalAlloc (0, sizeof(gifimage)); + data = GlobalLock(hglob); + memcpy(data, gifimage, sizeof(gifimage)); GlobalUnlock(hglob); - hr = CreateStreamOnHGlobal (hglob, FALSE, &stream); + hr = CreateStreamOnHGlobal (hglob, FALSE, &stream); ok_ole_success(hr, "CreateStreamOnHGlobal"); - hr = pOleLoadPicture(stream, sizeof(gifimage), TRUE, &IID_IPictureDisp, (void **)&picdisp); + hr = pOleLoadPicture(stream, sizeof(gifimage), TRUE, &IID_IPictureDisp, (void **)&picdisp); IStream_Release(stream); + GlobalFree(hglob); ok_ole_success(hr, "OleLoadPicture"); V_VT(&vararg) = VT_BOOL; -- 2.11.4.GIT