Commit 1c282736 authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

mshtml: Use the correct deallocator in the htmldoc tests for the memory returned…

mshtml: Use the correct deallocator in the htmldoc tests for the memory returned by IMoniker_GetDisplayName and fix a use-after-free error.
parent 3328ad6e
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment