mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
Merge pull request #1905 from heuripedes/master
(string_list.c) Initialize data after realloc()ing the list
This commit is contained in:
commit
f149db6173
@ -66,6 +66,9 @@ static bool string_list_capacity(struct string_list *list, size_t cap)
|
||||
if (!new_data)
|
||||
return false;
|
||||
|
||||
if (cap > list->cap)
|
||||
memset(&new_data[list->cap], 0, sizeof(*new_data) * (cap - list->cap));
|
||||
|
||||
list->elems = new_data;
|
||||
list->cap = cap;
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user