Kernel: Use kfree_sized() in KString

This commit is contained in:
Andreas Kling 2021-07-11 13:23:45 +02:00
parent c1e902acd9
commit 43d7a7f274
Notes: sideshowbarker 2024-07-18 09:20:09 +09:00

View file

@ -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);
}
}