mirror of
https://github.com/libretro/RetroArch.git
synced 2025-01-24 18:36:31 +00:00
core_backup_list_init - prevent garbage values
This commit is contained in:
parent
fded8ab357
commit
4c86e67c6e
@ -541,18 +541,22 @@ core_backup_list_t *core_backup_list_init(
|
||||
if (!backup_list)
|
||||
goto error;
|
||||
|
||||
backup_list->entries = NULL;
|
||||
backup_list->capacity = 0;
|
||||
backup_list->size = 0;
|
||||
|
||||
/* Create entries array
|
||||
* (Note: Set this to the full size of the directory
|
||||
* list - this may be larger than we need, but saves
|
||||
* many inefficiencies later) */
|
||||
entries = (core_backup_list_entry_t*)calloc(dir_list->size, sizeof(*entries));
|
||||
entries = (core_backup_list_entry_t*)
|
||||
calloc(dir_list->size, sizeof(*entries));
|
||||
|
||||
if (!entries)
|
||||
goto error;
|
||||
|
||||
backup_list->entries = entries;
|
||||
backup_list->capacity = dir_list->size;
|
||||
backup_list->size = 0;
|
||||
|
||||
/* Loop over backup files and parse file names */
|
||||
for (i = 0; i < dir_list->size; i++)
|
||||
|
Loading…
x
Reference in New Issue
Block a user