mirror of
https://github.com/Oibaf66/uae-wii.git
synced 2024-11-22 02:29:17 +01:00
Fixed memory leakage
This commit is contained in:
parent
0af0a1984e
commit
3b5d15fb2e
@ -1025,15 +1025,18 @@ static const char *menu_select_file_internal(const char *dir_path,
|
||||
}
|
||||
else opt = menu_select_sized("Select file", file_list, NULL, 0, x, y, x2, y2, NULL, NULL ,16);
|
||||
|
||||
if (opt < 0)
|
||||
return NULL;
|
||||
sel = strdup(file_list[opt]);
|
||||
sel = NULL;
|
||||
|
||||
if (opt >= 0) sel = strdup(file_list[opt]);
|
||||
|
||||
/* Cleanup everything - file_list is NULL-terminated */
|
||||
for ( i = 0; file_list[i]; i++ )
|
||||
free((void*)file_list[i]);
|
||||
free(file_list);
|
||||
|
||||
if (opt < 0)
|
||||
return NULL;
|
||||
|
||||
if (!sel)
|
||||
return NULL;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user