From 1ce8789ad0955be5aa42664844ef2b48cc06d464 Mon Sep 17 00:00:00 2001 From: Jon Coppeard Date: Thu, 29 Mar 2018 17:11:41 +0100 Subject: [PATCH] Bug 1440827 - Cancel preloaded requests if we decide not to use them r=baku --- dom/html/crashtests/1440827.html | 6 ++++++ dom/script/ScriptLoader.cpp | 1 + 2 files changed, 7 insertions(+) create mode 100644 dom/html/crashtests/1440827.html diff --git a/dom/html/crashtests/1440827.html b/dom/html/crashtests/1440827.html new file mode 100644 index 000000000000..ee204212ffb8 --- /dev/null +++ b/dom/html/crashtests/1440827.html @@ -0,0 +1,6 @@ + + + +> + + diff --git a/dom/script/ScriptLoader.cpp b/dom/script/ScriptLoader.cpp index 7bd73073b415..aa32d37f7eb0 100644 --- a/dom/script/ScriptLoader.cpp +++ b/dom/script/ScriptLoader.cpp @@ -1623,6 +1623,7 @@ ScriptLoader::LookupPreloadRequest(nsIScriptElement* aElement, mDocument->GetReferrerPolicy() != request->mReferrerPolicy || aScriptKind != request->mKind) { // Drop the preload. + request->Cancel(); AccumulateCategorical(LABELS_DOM_SCRIPT_PRELOAD_RESULT::RequestMismatch); return nullptr; }