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

This commit is contained in:
Nikolay Sivov 2015-04-11 12:05:25 +03:00 committed by Alexandre Julliard
parent 4cf70b1418
commit d6180c05b5
1 changed files with 10 additions and 5 deletions

View File

@ -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));
WCHAR *ret;
MultiByteToWideChar(CP_ACP, 0, szString, -1, wszString, INTERNET_MAX_URL_LENGTH);
if (!src)
return NULL;
return wszString;
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)