mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 03:32:46 +00:00
string_list_free - try to be safer
This commit is contained in:
parent
9c12037c43
commit
15e7078361
@ -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…
x
Reference in New Issue
Block a user