wininet: Don't free name before the IPv6 lookup.
This commit is contained in:
parent
d8d4aed845
commit
2329f91998
|
@ -184,18 +184,18 @@ BOOL GetAddress(LPCWSTR lpszServerName, INTERNET_PORT nServerPort,
|
||||||
hints.ai_family = AF_INET;
|
hints.ai_family = AF_INET;
|
||||||
|
|
||||||
ret = getaddrinfo( name, NULL, &hints, &res );
|
ret = getaddrinfo( name, NULL, &hints, &res );
|
||||||
heap_free( name );
|
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
{
|
{
|
||||||
TRACE("failed to get IPv4 address of %s (%s), retrying with IPv6\n", debugstr_w(lpszServerName), gai_strerror(ret));
|
TRACE("failed to get IPv4 address of %s (%s), retrying with IPv6\n", debugstr_w(lpszServerName), gai_strerror(ret));
|
||||||
hints.ai_family = AF_INET6;
|
hints.ai_family = AF_INET6;
|
||||||
ret = getaddrinfo( name, NULL, &hints, &res );
|
ret = getaddrinfo( name, NULL, &hints, &res );
|
||||||
|
}
|
||||||
|
heap_free( name );
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
{
|
{
|
||||||
TRACE("failed to get address of %s (%s)\n", debugstr_w(lpszServerName), gai_strerror(ret));
|
TRACE("failed to get address of %s (%s)\n", debugstr_w(lpszServerName), gai_strerror(ret));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (*sa_len < res->ai_addrlen)
|
if (*sa_len < res->ai_addrlen)
|
||||||
{
|
{
|
||||||
WARN("address too small\n");
|
WARN("address too small\n");
|
||||||
|
|
Loading…
Reference in New Issue