From 43d7a7f2745316ca096bc554f635e92d592b8ae6 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 11 Jul 2021 13:23:45 +0200 Subject: [PATCH] Kernel: Use kfree_sized() in KString --- Kernel/KString.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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::try_clone() const void KString::operator delete(void* string) { - kfree(string); + size_t allocation_size = sizeof(KString) + (sizeof(char) * static_cast(string)->m_length) + sizeof(char); + kfree_sized(string, allocation_size); } }