summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibC/dirent.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-08-07 23:35:28 +0200
committerAndreas Kling <kling@serenityos.org>2021-08-08 00:03:45 +0200
commit84656788bf473e99d9facb8fbc578ff24a4f31fc (patch)
tree2358ca571129a893013bb8b5b3fefd2338815453 /Userland/Libraries/LibC/dirent.cpp
parent3609ac4cf9af0ec38b464e652d9dc16427f85c04 (diff)
downloadserenity-84656788bf473e99d9facb8fbc578ff24a4f31fc.zip
Userland: Use kmalloc_array() where appropriate
Diffstat (limited to 'Userland/Libraries/LibC/dirent.cpp')
-rw-r--r--Userland/Libraries/LibC/dirent.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibC/dirent.cpp b/Userland/Libraries/LibC/dirent.cpp
index f0f3fb1b78..d92cf85050 100644
--- a/Userland/Libraries/LibC/dirent.cpp
+++ b/Userland/Libraries/LibC/dirent.cpp
@@ -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];
}