From 0f7bc2d8cca66bfc758694a95970fa0d0c183a0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Hentschel?= Date: Sun, 28 Oct 2012 16:16:37 +0100 Subject: [PATCH] gdi32: Avoid memory leaks (coverity). --- dlls/gdi32/bidi.c | 3 +++ dlls/gdi32/tests/bitmap.c | 3 ++- dlls/gdi32/tests/dib.c | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/dlls/gdi32/bidi.c b/dlls/gdi32/bidi.c index 03549967d84..00dce45413f 100644 --- a/dlls/gdi32/bidi.c +++ b/dlls/gdi32/bidi.c @@ -545,6 +545,9 @@ BOOL BIDI_Reorder( WARN("Out of memory\n"); HeapFree(GetProcessHeap(), 0, chartype); HeapFree(GetProcessHeap(), 0, levels); + HeapFree(GetProcessHeap(), 0, run_glyphs); + HeapFree(GetProcessHeap(), 0, pwLogClust); + HeapFree(GetProcessHeap(), 0, psva); return FALSE; } res = ScriptItemize(lpString + done, i, maxItems, &Control, &State, pItems, &nItems); diff --git a/dlls/gdi32/tests/bitmap.c b/dlls/gdi32/tests/bitmap.c index 04c93c1bfb9..f72574a7335 100644 --- a/dlls/gdi32/tests/bitmap.c +++ b/dlls/gdi32/tests/bitmap.c @@ -3741,7 +3741,7 @@ static void test_GdiAlphaBlend(void) DeleteObject(bmpDst); ReleaseDC(NULL, hdcNull); - + HeapFree(GetProcessHeap(), 0, bmi); } static void test_GdiGradientFill(void) @@ -3854,6 +3854,7 @@ static void test_GdiGradientFill(void) DeleteDC( hdc ); DeleteObject( bmp ); + HeapFree(GetProcessHeap(), 0, bmi); } static void test_clipping(void) diff --git a/dlls/gdi32/tests/dib.c b/dlls/gdi32/tests/dib.c index f4ed8e17aba..18c10673287 100644 --- a/dlls/gdi32/tests/dib.c +++ b/dlls/gdi32/tests/dib.c @@ -1308,6 +1308,7 @@ static void compare_hash_broken_todo(HDC hdc, BITMAPINFO *bmi, BYTE *bits, const if(current_sha1[i] == NULL) { ok(current_sha1[i] != NULL, "missing hash, got \"%s\",\n", hash); + HeapFree(GetProcessHeap(), 0, hash); return; } }