mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-14 14:28:47 +00:00
(string_list.c) Initialize data after realloc()ing the list
This commit is contained in:
parent
044ef3d3f4
commit
8c9c1df64b
@ -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…
Reference in New Issue
Block a user