mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:57:44 +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
|
@ -350,7 +350,7 @@ int putenv(char* new_var)
|
|||
|
||||
// At this point, we need to append the new var.
|
||||
// 2 here: one for the new var, one for the sentinel value.
|
||||
char** new_environ = (char**)malloc((environ_size + 2) * sizeof(char*));
|
||||
auto** new_environ = static_cast<char**>(kmalloc_array(environ_size + 2, sizeof(char*)));
|
||||
if (new_environ == nullptr) {
|
||||
errno = ENOMEM;
|
||||
return -1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue