mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 483788. Don't leak if a broken protocol handler returns a channel but error rv. r=bsmedberg, moa=biesi
This commit is contained in:
parent
982be663a1
commit
1e8ef860d0
@ -177,8 +177,8 @@ NS_NewChannel(nsIChannel **result,
|
||||
nsCOMPtr<nsIIOService> grip;
|
||||
rv = net_EnsureIOService(&ioService, grip);
|
||||
if (ioService) {
|
||||
nsIChannel *chan;
|
||||
rv = ioService->NewChannelFromURI(uri, &chan);
|
||||
nsCOMPtr<nsIChannel> chan;
|
||||
rv = ioService->NewChannelFromURI(uri, getter_AddRefs(chan));
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
if (loadGroup)
|
||||
rv |= chan->SetLoadGroup(loadGroup);
|
||||
@ -187,9 +187,7 @@ NS_NewChannel(nsIChannel **result,
|
||||
if (loadFlags != nsIRequest::LOAD_NORMAL)
|
||||
rv |= chan->SetLoadFlags(loadFlags);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
*result = chan;
|
||||
else
|
||||
NS_RELEASE(chan);
|
||||
chan.forget(result);
|
||||
}
|
||||
}
|
||||
return rv;
|
||||
|
Loading…
Reference in New Issue
Block a user