summaryrefslogtreecommitdiff
path: root/AK/String.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'AK/String.cpp')
-rw-r--r--AK/String.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/AK/String.cpp b/AK/String.cpp
index ac443a0ce5..c92c3c54eb 100644
--- a/AK/String.cpp
+++ b/AK/String.cpp
@@ -181,6 +181,9 @@ String::String(String&& other)
String& String::operator=(String&& other)
{
+ if (!is_short_string())
+ m_data->unref();
+
m_data = exchange(other.m_data, nullptr);
return *this;
}