mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 732319. Fix leaks on CORS failures in imagelib. r=joe
This commit is contained in:
parent
ea8d2e3b58
commit
a7d0a9267e
@ -1718,12 +1718,19 @@ NS_IMETHODIMP imgLoader::LoadImage(nsIURI *aURI,
|
||||
// request.
|
||||
nsCOMPtr<nsIStreamListener> listener = pl;
|
||||
if (corsmode != imgIRequest::CORS_NONE) {
|
||||
PR_LOG(gImgLog, PR_LOG_DEBUG,
|
||||
("[this=%p] imgLoader::LoadImage -- Setting up a CORS load",
|
||||
this));
|
||||
bool withCredentials = corsmode == imgIRequest::CORS_USE_CREDENTIALS;
|
||||
|
||||
nsCOMPtr<nsIStreamListener> corsproxy =
|
||||
new nsCORSListenerProxy(pl, aLoadingPrincipal, newChannel,
|
||||
withCredentials, &rv);
|
||||
if (NS_FAILED(rv)) {
|
||||
PR_LOG(gImgLog, PR_LOG_DEBUG,
|
||||
("[this=%p] imgLoader::LoadImage -- nsCORSListenerProxy "
|
||||
"creation failed: 0x%x\n", this, rv));
|
||||
request->CancelAndAbort(rv);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
2
image/test/crashtests/732319-1.html
Normal file
2
image/test/crashtests/732319-1.html
Normal file
@ -0,0 +1,2 @@
|
||||
<!DOCTYPE html>
|
||||
<img crossorigin src="data:a/a,">
|
@ -25,3 +25,4 @@ HTTP load delayedframe.sjs
|
||||
|
||||
load 681190.html
|
||||
load 694165-1.xhtml
|
||||
load 732319-1.html
|
||||
|
Loading…
Reference in New Issue
Block a user