From 4b6a846d9cfc3619a4477bbfa8bca9bbe2c5baa1 Mon Sep 17 00:00:00 2001 From: dominik Date: Sat, 8 Jan 2005 19:34:00 +0000 Subject: [PATCH] (svn r1434) Fix: [ 1098553 ] Crash when all vehicles from a vehicles per station list had been removed --- vehicle_gui.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vehicle_gui.c b/vehicle_gui.c index 5c8cd07592..78cd4bd03a 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;