mirror of
https://github.com/reactos/wine.git
synced 2024-11-24 20:30:01 +00:00
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));
|
||||
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user