1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 16:07:46 +00:00

Userland: Use kmalloc_array() where appropriate

This commit is contained in:
Andreas Kling 2021-08-07 23:35:28 +02:00
parent 3609ac4cf9
commit 84656788bf
4 changed files with 14 additions and 14 deletions

View file

@ -255,7 +255,7 @@ int scandir(const char* dir_name,
}
const int size = tmp_names.size();
auto names = (struct dirent**)malloc(size * sizeof(struct dirent*));
auto** names = static_cast<struct dirent**>(kmalloc_array(size, sizeof(struct dirent*)));
for (auto i = 0; i < size; i++) {
names[i] = tmp_names[i];
}