summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordominik <dominik@openttd.org>2005-01-08 19:34:00 +0000
committerdominik <dominik@openttd.org>2005-01-08 19:34:00 +0000
commit4b6a846d9cfc3619a4477bbfa8bca9bbe2c5baa1 (patch)
tree8dac8a30a94da641b3d2101f9228534882749cdd
parent5110ffeef4b0e4a9350055a927948ebeafd2f4e9 (diff)
downloadopenttd-4b6a846d9cfc3619a4477bbfa8bca9bbe2c5baa1.tar.xz
(svn r1434) Fix: [ 1098553 ] Crash when all vehicles from a vehicles per station list had been removed
-rw-r--r--vehicle_gui.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/vehicle_gui.c b/vehicle_gui.c
index 5c8cd0759..78cd4bd03 100644
--- a/vehicle_gui.c
+++ b/vehicle_gui.c
@@ -120,7 +120,7 @@ void BuildVehicleList(vehiclelist_d *vl, int type, int owner, int station)
}
vl->sort_list = realloc(vl->sort_list, n * sizeof(vl->sort_list[0]));
- if (vl->sort_list == NULL)
+ if (n!=0 && vl->sort_list == NULL)
error("Could not allocate memory for the vehicle-sorting-list");
vl->list_length = n;