ws2_32: Fix ai_canonname buffer allocation in addrinfo_AtoW.
This commit is contained in:
parent
5ea2bdda5d
commit
51e77324dd
@ -6120,7 +6120,7 @@ static struct WS_addrinfoW *addrinfo_AtoW(const struct WS_addrinfo *ai)
|
|||||||
if (ai->ai_canonname)
|
if (ai->ai_canonname)
|
||||||
{
|
{
|
||||||
int len = MultiByteToWideChar(CP_ACP, 0, ai->ai_canonname, -1, NULL, 0);
|
int len = MultiByteToWideChar(CP_ACP, 0, ai->ai_canonname, -1, NULL, 0);
|
||||||
if (!(ret->ai_canonname = HeapAlloc(GetProcessHeap(), 0, len)))
|
if (!(ret->ai_canonname = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR))))
|
||||||
{
|
{
|
||||||
HeapFree(GetProcessHeap(), 0, ret);
|
HeapFree(GetProcessHeap(), 0, ret);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user