mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
AK: Fix leak in JsonValue::operator=(JsonValue&&).
Amusingly I introduced this leak while explaining that this type of leak is a common bug, and saying I'm used to looking for it. :^)
This commit is contained in:
@@ -53,6 +53,7 @@ JsonValue::JsonValue(JsonValue&& other)
|
||||
JsonValue& JsonValue::operator=(JsonValue&& other)
|
||||
{
|
||||
if (this != &other) {
|
||||
clear();
|
||||
m_type = exchange(other.m_type, Type::Undefined);
|
||||
m_value.as_string = exchange(other.m_value.as_string, nullptr);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user