Bug 1517600 - Call ReleaseListeners() in HttpChannelChild::AsyncOpen when NS_CheckPortSafety fails r=baku

The big leak was caused by not clearing mCallbacks.

Differential Revision: https://phabricator.services.mozilla.com/D17220

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Valentin Gosu 2019-01-22 17:45:47 +00:00
parent 70df5bbf20
commit a9b850e10e

View File

@ -2444,7 +2444,10 @@ HttpChannelChild::AsyncOpen(nsIStreamListener* listener,
// immediately
nsresult rv;
rv = NS_CheckPortSafety(mURI);
if (NS_FAILED(rv)) return rv;
if (NS_FAILED(rv)) {
ReleaseListeners();
return rv;
}
nsAutoCString cookie;
if (NS_SUCCEEDED(mRequestHead.GetHeader(nsHttp::Cookie, cookie))) {