(svn r27974) -Fix (r27907) [FS#6627]: free() called on static airport rotation data (JGR)

This commit is contained in:
peter1138 2018-03-06 07:48:29 +00:00
parent 50fb460203
commit dacd8d87ef
1 changed files with 4 additions and 0 deletions

View File

@ -3672,6 +3672,9 @@ static void DuplicateTileTable(AirportSpec *as)
HangarTileTable *depot_table = MallocT<HangarTileTable>(as->nof_depots);
MemCpyT(depot_table, as->depot_table, as->nof_depots);
as->depot_table = depot_table;
Direction *rotation = MallocT<Direction>(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<Direction>(as->num_table);
uint32 defsize = buf->ReadDWord(); // Total size of the definition