Skip to content

Commit

Permalink
fix: allocation size for file item
Browse files Browse the repository at this point in the history
  • Loading branch information
Otrebor671 committed Aug 8, 2024
1 parent 320c47b commit c52fbbb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion firmware/main/modules/file_manager/file_manager_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ static void update_files() {
uint16_t idx = 0;
while ((entry = readdir(dir)) != NULL) {
if (entry->d_type == DT_REG || entry->d_type == DT_DIR) {
file_item_t* item = malloc(sizeof(file_item_t*)); // check false
file_item_t* item = malloc(sizeof(file_item_t)); // check false
item->is_dir = (entry->d_type == DT_DIR);
item->name = strdup(entry->d_name); // check false
size_t path_len =
Expand Down

0 comments on commit c52fbbb

Please sign in to comment.