mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 09:04:59 +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:
parent
4147394dcb
commit
92cda74724
1 changed files with 1 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue