diff --git a/dlls/usp10/tests/usp10.c b/dlls/usp10/tests/usp10.c index 73615de3c0d..158f201659f 100644 --- a/dlls/usp10/tests/usp10.c +++ b/dlls/usp10/tests/usp10.c @@ -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) diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c index 3e1258dc2f1..576b05654ee 100644 --- a/dlls/usp10/usp10.c +++ b/dlls/usp10/usp10.c @@ -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;