mshtml: Use the correct deallocator in the htmldoc tests for the memory returned by IMoniker_GetDisplayName and fix a use-after-free error.

This commit is contained in:
Rob Shearman 2007-12-05 16:28:36 +00:00 committed by Alexandre Julliard
parent 3328ad6eb9
commit 1c28273686
1 changed files with 4 additions and 4 deletions

View File

@ -2506,7 +2506,7 @@ static void test_GetCurMoniker(IUnknown *unk, IMoniker *exmon, LPCWSTR exurl)
IPersistMoniker_Release(permon);
if(exmon) {
BSTR url;
LPOLESTR url;
BOOL exb = expect_GetDisplayName;
BOOL clb = called_GetDisplayName;
@ -2520,10 +2520,10 @@ static void test_GetCurMoniker(IUnknown *unk, IMoniker *exmon, LPCWSTR exurl)
expect_GetDisplayName = exb;
called_GetDisplayName = clb;
SysFreeString(url);
ok(!lstrcmpW(url, doc_url), "url != doc_url\n");
CoTaskMemFree(url);
}else if(exurl) {
BSTR url;
LPOLESTR url;
ok(hres == S_OK, "GetCurrentMoniker failed: %08x\n", hres);
@ -2533,7 +2533,7 @@ static void test_GetCurMoniker(IUnknown *unk, IMoniker *exmon, LPCWSTR exurl)
ok(!lstrcmpW(url, exurl), "unexpected url\n");
ok(!lstrcmpW(url, doc_url), "url != doc_url\n");
SysFreeString(url);
CoTaskMemFree(url);
}else {
ok(hres == E_UNEXPECTED,
"GetCurrentMoniker failed: %08x, expected E_UNEXPECTED\n", hres);