From dacd8d87efb9892245f9575e3abea84ec44d814e Mon Sep 17 00:00:00 2001 From: peter1138 Date: Tue, 6 Mar 2018 07:48:29 +0000 Subject: (svn r27974) -Fix (r27907) [FS#6627]: free() called on static airport rotation data (JGR) --- src/newgrf.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 4759c8a19..704892e5c 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -3672,6 +3672,9 @@ static void DuplicateTileTable(AirportSpec *as) HangarTileTable *depot_table = MallocT(as->nof_depots); MemCpyT(depot_table, as->depot_table, as->nof_depots); as->depot_table = depot_table; + Direction *rotation = MallocT(as->num_table); + MemCpyT(rotation, as->rotation, as->num_table); + as->rotation = rotation; } /** @@ -3741,6 +3744,7 @@ static ChangeInfoResult AirportChangeInfo(uint airport, int numinfo, int prop, B } case 0x0A: { // Set airport layout + free(as->rotation); as->num_table = buf->ReadByte(); // Number of layaouts as->rotation = MallocT(as->num_table); uint32 defsize = buf->ReadDWord(); // Total size of the definition -- cgit v1.2.3-54-g00ecf