Commit 51e77324 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

ws2_32: Fix ai_canonname buffer allocation in addrinfo_AtoW.

parent 5ea2bdda
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment