LibWeb: Fix use-after-move in URLSearchParams::update

This was previously still valid since the `Optional<String>` move
constructor copied its input, but since the move is now destructive,
the code no longer works.
This commit is contained in:
Jonne Ransijn 2024-10-29 20:04:39 +01:00 committed by Andreas Kling
parent 2457118024
commit a733e2a31c
Notes: github-actions[bot] 2024-10-31 22:27:17 +00:00

View file

@ -228,7 +228,7 @@ void URLSearchParams::update()
serialized_query = {};
// 4. Set querys URL objects URLs query to serializedQuery.
m_url->set_query({}, move(serialized_query));
m_url->set_query({}, serialized_query);
// 5. If serializedQuery is null, then potentially strip trailing spaces from an opaque path with querys URL object.
if (!serialized_query.has_value())