crash-on-exit because of #4b0a3cba
Submitted by René J.V. Bertin
Assigned to Xorg Project Team
Freeing the fbconfigs list entries (commit #4b0a3cba) introduced a bug that causes a systematic crash on exit on Mac (abort when freeing a pointer that wasn't allocated).
At least on OS X 10.9.5 (or on my mid 2011 13" MPB with an Intel HD3000 GPU) the fbconfigs list contains items that are members of an array and should thus not be freed individually.
Sadly they are not added to the list in order, so a simple address comparison of the type
config == &previous does not prevent the crash.
I have to assume this issue does not arise on other platforms; maybe the easy "fix" would be to leave the freeing of this memory to the OS on Mac? A true fix would involve changing the code that adds fbconfigs to the list; fixing the free loop would require unjustified complexity for something only executed on exit, IMHO.