mirror of
https://github.com/libretro/RetroArch
synced 2025-04-16 17:43:02 +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)
|
if (!backup_list)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
backup_list->entries = NULL;
|
||||||
|
backup_list->capacity = 0;
|
||||||
|
backup_list->size = 0;
|
||||||
|
|
||||||
/* Create entries array
|
/* Create entries array
|
||||||
* (Note: Set this to the full size of the directory
|
* (Note: Set this to the full size of the directory
|
||||||
* list - this may be larger than we need, but saves
|
* list - this may be larger than we need, but saves
|
||||||
* many inefficiencies later) */
|
* 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)
|
if (!entries)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
backup_list->entries = entries;
|
backup_list->entries = entries;
|
||||||
backup_list->capacity = dir_list->size;
|
backup_list->capacity = dir_list->size;
|
||||||
backup_list->size = 0;
|
|
||||||
|
|
||||||
/* Loop over backup files and parse file names */
|
/* Loop over backup files and parse file names */
|
||||||
for (i = 0; i < dir_list->size; i++)
|
for (i = 0; i < dir_list->size; i++)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user