Fix another null dereference

This commit is contained in:
Alex Taber
2020-12-24 18:27:48 -05:00
parent c801e28523
commit a647494306

View File

@@ -410,9 +410,12 @@ static bool load_icons(Entry_List_s * current_list, Handle mutex)
int index = indexes[i]; int index = indexes[i];
C2D_Image * image = icons[index]; C2D_Image * image = icons[index];
C3D_TexDelete(image->tex); if (icons[index] != NULL)
free(image->tex); {
free(image); C3D_TexDelete(image->tex);
free(image->tex);
free(image);
}
icons[index] = load_entry_icon(*current_entry); icons[index] = load_entry_icon(*current_entry);