mirror of
https://github.com/libretro/RetroArch.git
synced 2025-04-02 10:51:52 -04:00
string_list_free - try to be safer
This commit is contained in:
parent
9c12037c43
commit
15e7078361
1 changed files with 9 additions and 6 deletions
|
@ -41,15 +41,18 @@ void string_list_free(struct string_list *list)
|
|||
if (!list)
|
||||
return;
|
||||
|
||||
for (i = 0; i < list->size; i++)
|
||||
if (list->elems)
|
||||
{
|
||||
if (list->elems[i].data)
|
||||
free(list->elems[i].data);
|
||||
list->elems[i].data = NULL;
|
||||
for (i = 0; i < list->size; i++)
|
||||
{
|
||||
if (list->elems[i].data)
|
||||
free(list->elems[i].data);
|
||||
list->elems[i].data = NULL;
|
||||
}
|
||||
|
||||
free(list->elems);
|
||||
}
|
||||
|
||||
if (list->elems)
|
||||
free(list->elems);
|
||||
list->elems = NULL;
|
||||
free(list);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue