Commit d6180c05 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

shlwapi/tests: Fix uninitialized memory reads (Valgrind).

parent 4cf70b14
......@@ -183,13 +183,18 @@ static const struct {
/* ################ */
static LPWSTR GetWideString(const char* szString)
static LPWSTR GetWideString(const char *src)
{
LPWSTR wszString = HeapAlloc(GetProcessHeap(), 0, (2*INTERNET_MAX_URL_LENGTH) * sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, szString, -1, wszString, INTERNET_MAX_URL_LENGTH);
WCHAR *ret;
return wszString;
if (!src)
return NULL;
ret = HeapAlloc(GetProcessHeap(), 0, (2*INTERNET_MAX_URL_LENGTH) * sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, src, -1, ret, INTERNET_MAX_URL_LENGTH);
return ret;
}
static void FreeWideString(LPWSTR wszString)
......
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