зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1744940
- Prevent leak when nsHttpHandler::NewProxiedChannel is called during shutdown r=necko-reviewers,kershaw
In 1738984 we added this early return when the method is called during shutdown to prevent NSS from being initialized and to fail things as early as possible. However, this check belongs at the top of the method, not after the allocation. Differential Revision: https://phabricator.services.mozilla.com/D133335
This commit is contained in:
Родитель
073ffe9321
Коммит
b984c37dc7
|
@ -2048,6 +2048,11 @@ NS_IMETHODIMP
|
|||
nsHttpHandler::NewProxiedChannel(nsIURI* uri, nsIProxyInfo* givenProxyInfo,
|
||||
uint32_t proxyResolveFlags, nsIURI* proxyURI,
|
||||
nsILoadInfo* aLoadInfo, nsIChannel** result) {
|
||||
// Avoid a late initialization
|
||||
if (AppShutdown::IsInOrBeyond(ShutdownPhase::AppShutdownNetTeardown)) {
|
||||
return NS_ERROR_ILLEGAL_DURING_SHUTDOWN;
|
||||
}
|
||||
|
||||
HttpBaseChannel* httpChannel;
|
||||
|
||||
LOG(("nsHttpHandler::NewProxiedChannel [proxyInfo=%p]\n", givenProxyInfo));
|
||||
|
@ -2060,11 +2065,6 @@ nsHttpHandler::NewProxiedChannel(nsIURI* uri, nsIProxyInfo* givenProxyInfo,
|
|||
httpChannel = new nsHttpChannel();
|
||||
}
|
||||
|
||||
// Avoid a late initialization
|
||||
if (AppShutdown::IsInOrBeyond(ShutdownPhase::AppShutdownNetTeardown)) {
|
||||
return NS_ERROR_ILLEGAL_DURING_SHUTDOWN;
|
||||
}
|
||||
|
||||
return SetupChannelInternal(httpChannel, uri, givenProxyInfo,
|
||||
proxyResolveFlags, proxyURI, aLoadInfo, result);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче