usp10: Fix some more memory leaks.

oldstable
Hans Leidekker 2007-11-08 19:18:30 +01:00 committed by Alexandre Julliard
parent 66c6b84ff0
commit 106dbd5617
2 changed files with 7 additions and 1 deletions

View File

@ -640,6 +640,7 @@ static void test_ScriptString(HDC hdc)
ReqWidth, &Control, &State, Dx, &Tabdef,
&InClass, &ssa);
ok(hr == S_OK, "ScriptStringAnalyse should return S_OK not %08x\n", hr);
ScriptStringFree(&ssa);
/* test makes sure that a call with a valid pssa still works */
hr = ScriptStringAnalyse( hdc, teststr, len, Glyphs, Charset, Flags,
@ -844,8 +845,9 @@ static void test_ScriptCacheGetHeight(HDC hdc)
hr = ScriptCacheGetHeight(hdc, &sc, &height);
ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
ok(height > 0, "expected height > 0\n");
ScriptFreeCache(&sc);
}
static void test_ScriptGetGlyphABCWidth(HDC hdc)
@ -867,6 +869,8 @@ static void test_ScriptGetGlyphABCWidth(HDC hdc)
hr = ScriptGetGlyphABCWidth(hdc, &sc, 'a', &abc);
ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
ScriptFreeCache(&sc);
}
static void test_ScriptLayout(void)

View File

@ -660,6 +660,7 @@ error:
usp_free(analysis->glyphs);
usp_free(analysis->logattrs);
usp_free(analysis->pItem);
usp_free(analysis->sc);
usp_free(analysis);
return hr;
}
@ -887,6 +888,7 @@ HRESULT WINAPI ScriptStringFree(SCRIPT_STRING_ANALYSIS *pssa)
usp_free(analysis->pItem);
usp_free(analysis->logattrs);
usp_free(analysis->sz);
usp_free(analysis->sc);
usp_free(analysis);
if (invalid) return E_INVALIDARG;