Commit 9be5df10 authored by Frédéric Delanoy's avatar Frédéric Delanoy Committed by Alexandre Julliard

shlwapi/tests: Avoid memory leaks (coverity).

parent 799c2fb8
......@@ -2272,7 +2272,7 @@ static const IServiceProviderVtbl IServiceProviderImpl_Vtbl =
static void test_IUnknown_QueryServiceExec(void)
{
IServiceProvider *provider = IServiceProviderImpl_Construct();
IServiceProvider *provider;
static const GUID dummy_serviceid = { 0xdeadbeef };
static const GUID dummy_groupid = { 0xbeefbeef };
call_trace_t trace_expected;
......@@ -2286,6 +2286,8 @@ static void test_IUnknown_QueryServiceExec(void)
return;
}
provider = IServiceProviderImpl_Construct();
/* null source pointer */
hr = pIUnknown_QueryServiceExec(NULL, &dummy_serviceid, &dummy_groupid, 0, 0, 0, 0);
ok(hr == E_FAIL, "got 0x%08x\n", hr);
......@@ -2384,8 +2386,8 @@ static const IProfferServiceVtbl IProfferServiceImpl_Vtbl =
static void test_IUnknown_ProfferService(void)
{
IServiceProvider *provider = IServiceProviderImpl_Construct();
IProfferService *proff = IProfferServiceImpl_Construct();
IServiceProvider *provider;
IProfferService *proff;
static const GUID dummy_serviceid = { 0xdeadbeef };
call_trace_t trace_expected;
HRESULT hr;
......@@ -2399,6 +2401,9 @@ static void test_IUnknown_ProfferService(void)
return;
}
provider = IServiceProviderImpl_Construct();
proff = IProfferServiceImpl_Construct();
/* null source pointer */
hr = pIUnknown_ProfferService(NULL, &dummy_serviceid, 0, 0);
ok(hr == E_FAIL, "got 0x%08x\n", hr);
......
......@@ -1082,10 +1082,7 @@ static void test_url_combine(const char *szUrl1, const char *szUrl2, DWORD dwFla
HRESULT hr;
CHAR szReturnUrl[INTERNET_MAX_URL_LENGTH];
WCHAR wszReturnUrl[INTERNET_MAX_URL_LENGTH];
LPWSTR wszUrl1 = GetWideString(szUrl1);
LPWSTR wszUrl2 = GetWideString(szUrl2);
LPWSTR wszExpectUrl = GetWideString(szExpectUrl);
LPWSTR wszConvertedUrl;
LPWSTR wszUrl1, wszUrl2, wszExpectUrl, wszConvertedUrl;
DWORD dwSize;
DWORD dwExpectLen = lstrlenA(szExpectUrl);
......@@ -1095,6 +1092,10 @@ static void test_url_combine(const char *szUrl1, const char *szUrl2, DWORD dwFla
return;
}
wszUrl1 = GetWideString(szUrl1);
wszUrl2 = GetWideString(szUrl2);
wszExpectUrl = GetWideString(szExpectUrl);
hr = pUrlCombineA(szUrl1, szUrl2, NULL, NULL, dwFlags);
ok(hr == E_INVALIDARG, "UrlCombineA returned 0x%08x, expected 0x%08x\n", hr, E_INVALIDARG);
......
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