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:
Andreas Kling 2019-06-18 09:22:19 +02:00
parent 4147394dcb
commit 92cda74724

View file

@ -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);
}