summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2018-03-06 07:48:29 +0000
committerpeter1138 <peter1138@openttd.org>2018-03-06 07:48:29 +0000
commitdacd8d87efb9892245f9575e3abea84ec44d814e (patch)
tree5192614ca4aa3e4029256f8f10ef163b477307e3 /src
parent50fb460203b52a93f1892d8c35955087d11193b4 (diff)
downloadopenttd-dacd8d87efb9892245f9575e3abea84ec44d814e.tar.xz
(svn r27974) -Fix (r27907) [FS#6627]: free() called on static airport rotation data (JGR)
Diffstat (limited to 'src')
-rw-r--r--src/newgrf.cpp4
1 files changed, 4 insertions, 0 deletions
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<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