shlwapi/tests: Fix uninitialized memory reads (Valgrind).
This commit is contained in:
parent
4cf70b1418
commit
d6180c05b5
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue