You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In src/table/airport_defaults.h, _origin_airport_specs is initialised with rotation data pointer set to reference _default_airports_rotation, which is declared as `static const Direction _default_airports_rotation[]`.
In src/newgrf.cpp AirportChangeInfo() (case for prop 0x08: Modify original airport), a new AirportSpec is allocated and initialised by copying an AirportSpec in _origin_airport_specs, this includes the rotation data pointer, pointing at static data.
In src/newgrf.cpp ResetCustomAirports() the rotation data pointer in the AirportSpec allocated in AirportChangeInfo() is freed.
As this is not a valid pointer returned by malloc() (or null) the program aborts.
This call to free() was added in r27907.
The other malloced fields of AirportSpec are correctly handled by mallocing copies in DuplicateTileTable().
I've attached a suggested fix which removes the issue without re-adding the leak fixed in r27907.
JGR opened the ticket and wrote:
Attachments
Reported version: trunk
Operating system: All
This issue was imported from FlySpray: https://bugs.openttd.org/task/6627
The text was updated successfully, but these errors were encountered: