From 92cda74724fbaca00b36626e56ff132f219697ea Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 18 Jun 2019 09:22:19 +0200 Subject: [PATCH] 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. :^) --- AK/JsonValue.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/AK/JsonValue.cpp b/AK/JsonValue.cpp index 216160f10d..0cf0760304 100644 --- a/AK/JsonValue.cpp +++ b/AK/JsonValue.cpp @@ -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); }