Merge pull request #1905 from heuripedes/master

(string_list.c) Initialize data after realloc()ing the list
This commit is contained in:
Twinaphex 2015-07-06 11:27:47 +02:00
commit f149db6173

View File

@ -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;