ws2_32: Fix ai_canonname buffer allocation in addrinfo_AtoW.

oldstable
Piotr Caban 2015-05-08 18:01:58 +02:00 committed by Alexandre Julliard
parent 5ea2bdda5d
commit 51e77324dd
1 changed files with 1 additions and 1 deletions

View File

@ -6120,7 +6120,7 @@ static struct WS_addrinfoW *addrinfo_AtoW(const struct WS_addrinfo *ai)
if (ai->ai_canonname)
{
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);
return NULL;