mshtml: Don't use wine_uri in nsIIOService::NewChannelFromURI implementation.

This commit is contained in:
Jacek Caban 2010-11-25 13:56:03 +01:00 committed by Alexandre Julliard
parent 74aabe94b1
commit 286249031c
1 changed files with 10 additions and 3 deletions

View File

@ -2829,10 +2829,10 @@ static nsresult NSAPI nsIOService_NewFileURI(nsIIOService *iface, nsIFile *aFile
static nsresult NSAPI nsIOService_NewChannelFromURI(nsIIOService *iface, nsIURI *aURI,
nsIChannel **_retval)
{
PARSEDURLW parsed_url = {sizeof(PARSEDURLW)};
nsChannel *ret;
nsWineURI *wine_uri;
nsresult nsres;
HRESULT hres;
TRACE("(%p %p)\n", aURI, _retval);
@ -2842,6 +2842,11 @@ static nsresult NSAPI nsIOService_NewChannelFromURI(nsIIOService *iface, nsIURI
return nsIIOService_NewChannelFromURI(nsio, aURI, _retval);
}
if(!ensure_uri(wine_uri)) {
nsIURI_Release(NSURI(wine_uri));
return NS_ERROR_UNEXPECTED;
}
ret = heap_alloc_zero(sizeof(nsChannel));
ret->lpHttpChannelVtbl = &nsChannelVtbl;
@ -2855,8 +2860,10 @@ static nsresult NSAPI nsIOService_NewChannelFromURI(nsIIOService *iface, nsIURI
nsIURI_AddRef(aURI);
ret->original_uri = aURI;
ret->url_scheme = wine_uri->wine_url && SUCCEEDED(ParseURLW(wine_uri->wine_url, &parsed_url))
? parsed_url.nScheme : URL_SCHEME_UNKNOWN;
hres = IUri_GetScheme(wine_uri->uri, &ret->url_scheme);
if(FAILED(hres))
ret->url_scheme = URL_SCHEME_UNKNOWN;
*_retval = NSCHANNEL(ret);
return NS_OK;