1
0
mirror of https://github.com/libretro/RetroArch synced 2024-07-08 12:15:49 +00:00

core_backup_list_init - prevent garbage values

This commit is contained in:
twinaphex 2020-06-29 19:18:43 +02:00
parent fded8ab357
commit 4c86e67c6e

View File

@ -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++)