summaryrefslogtreecommitdiff
path: root/src/roadveh_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/roadveh_cmd.cpp')
-rw-r--r--src/roadveh_cmd.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp
index 35fc275d5..7ecd0779b 100644
--- a/src/roadveh_cmd.cpp
+++ b/src/roadveh_cmd.cpp
@@ -194,7 +194,7 @@ CommandCost CmdBuildRoadVeh(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
uint num_vehicles = 1 + CountArticulatedParts(p1, false);
/* Allow for the front and the articulated parts, plus one to "terminate" the list. */
- Vehicle **vl = (Vehicle**)alloca(sizeof(*vl) * (num_vehicles + 1));
+ Vehicle **vl = AllocaM(Vehicle*, num_vehicles + 1);
memset(vl, 0, sizeof(*vl) * (num_vehicles + 1));
if (!Vehicle::AllocateList(vl, num_vehicles)) {