From 43f75dcba0815238b1440eb07c75904726f95809 Mon Sep 17 00:00:00 2001 From: Shannon Booth Date: Mon, 25 Nov 2024 09:48:23 +1300 Subject: [PATCH] LibWeb: Don't store reference to temporary in resolve_module_specifier An environment settings object will return a copy to the URL. From a quick glance, we could probably make an environment settings object return a reference to one, but let's just change this code to make a copy since its not safe to rely on that. --- Libraries/LibWeb/HTML/Scripting/Fetching.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Libraries/LibWeb/HTML/Scripting/Fetching.cpp b/Libraries/LibWeb/HTML/Scripting/Fetching.cpp index 007aca09f7..ad5e1a1bb3 100644 --- a/Libraries/LibWeb/HTML/Scripting/Fetching.cpp +++ b/Libraries/LibWeb/HTML/Scripting/Fetching.cpp @@ -85,8 +85,8 @@ ByteString module_type_from_module_request(JS::ModuleRequest const& module_reque WebIDL::ExceptionOr resolve_module_specifier(Optional referring_script, ByteString const& specifier) { // 1. Let settingsObject and baseURL be null. - Optional settings_object; - Optional base_url; + GC::Ptr settings_object; + Optional base_url; // 2. If referringScript is not null, then: if (referring_script.has_value()) {