mirror of
https://github.com/libretro/RetroArch.git
synced 2025-04-02 10:51:52 -04:00
(string_list.c) Initialize data after realloc()ing the list
This commit is contained in:
parent
044ef3d3f4
commit
8c9c1df64b
1 changed files with 3 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue