winhttp: Do not free name too early (Coverity).

This commit is contained in:
Marcus Meissner 2012-12-27 19:43:27 +01:00 committed by Alexandre Julliard
parent e0fa39b3e0
commit ab6369231f
1 changed files with 2 additions and 1 deletions

View File

@ -1247,7 +1247,6 @@ BOOL WINAPI WinHttpDetectAutoProxyConfigUrl( DWORD flags, LPWSTR *url )
strcpy( name, "wpad" );
strcat( name, p );
res = getaddrinfo( name, NULL, NULL, &ai );
heap_free( name );
if (!res)
{
*url = build_wpad_url( name, ai );
@ -1255,10 +1254,12 @@ BOOL WINAPI WinHttpDetectAutoProxyConfigUrl( DWORD flags, LPWSTR *url )
if (*url)
{
TRACE("returning %s\n", debugstr_w(*url));
heap_free( name );
ret = TRUE;
break;
}
}
heap_free( name );
p++;
}
heap_free( domain );