Commit 9312c453 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

winhttp: Use GlobalAlloc to allocate lpszProxy in WinHttpGetProxyForUrl.

parent ff77a49a
......@@ -1896,7 +1896,17 @@ static BOOL parse_script_result( const char *result, WINHTTP_PROXY_INFO *info )
p += 5;
while (*p == ' ') p++;
if (!*p || *p == ';') return TRUE;
if (!(info->lpszProxy = q = strdupAW( p ))) return FALSE;
if (!(q = strdupAW( p ))) return FALSE;
len = wcslen( q );
info->lpszProxy = GlobalAlloc( 0, (len + 1) * sizeof(WCHAR) );
if (!info->lpszProxy)
{
free( q );
return FALSE;
}
memcpy( info->lpszProxy, q, (len + 1) * sizeof(WCHAR) );
free( q );
q = info->lpszProxy;
info->dwAccessType = WINHTTP_ACCESS_TYPE_NAMED_PROXY;
for (; *q; q++)
{
......
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