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:
parent
3609ac4cf9
commit
84656788bf
4 changed files with 14 additions and 14 deletions
|
@ -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];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue