summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-07-11 13:23:45 +0200
committerAndreas Kling <kling@serenityos.org>2021-07-11 14:14:51 +0200
commit43d7a7f2745316ca096bc554f635e92d592b8ae6 (patch)
tree71a641c8093a903257e517be90f5f2497220e104
parentc1e902acd9cf3c1fc7c8e0b7c61c25717fcd3aae (diff)
downloadserenity-43d7a7f2745316ca096bc554f635e92d592b8ae6.zip
Kernel: Use kfree_sized() in KString
-rw-r--r--Kernel/KString.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/Kernel/KString.cpp b/Kernel/KString.cpp
index 7cc826f52e..201554938d 100644
--- a/Kernel/KString.cpp
+++ b/Kernel/KString.cpp
@@ -59,7 +59,8 @@ OwnPtr<KString> KString::try_clone() const
void KString::operator delete(void* string)
{
- kfree(string);
+ size_t allocation_size = sizeof(KString) + (sizeof(char) * static_cast<KString*>(string)->m_length) + sizeof(char);
+ kfree_sized(string, allocation_size);
}
}