mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Fix wrong allocation failure check in dscandir_r(3).
This commit is contained in:
parent
8d41d3ceb0
commit
3c160977bf
1 changed files with 1 additions and 1 deletions
|
@ -70,7 +70,7 @@ int scandir(const char* path, struct dirent*** namelist_ptr,
|
|||
size_t name_length = strlen(entry->d_name);
|
||||
size_t dirent_size = sizeof(struct dirent) + name_length + 1;
|
||||
struct dirent* dirent = (struct dirent*) malloc(dirent_size);
|
||||
if ( !dirent_size )
|
||||
if ( !dirent )
|
||||
goto out_error;
|
||||
memcpy(dirent, entry, sizeof(*entry));
|
||||
strcpy(dirent->d_name, entry->d_name);
|
||||
|
|
Loading…
Add table
Reference in a new issue